From 08c1402cc46ddd386fde0744c039cf2354982cbb Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sat, 3 Mar 2012 01:13:36 -0500 Subject: Clean up link copying code. --- background_page.html | 8 -------- linkHints.js | 6 +----- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/background_page.html b/background_page.html index aca4206b..aed9617b 100644 --- a/background_page.html +++ b/background_page.html @@ -40,7 +40,6 @@ upgradeNotificationClosed: upgradeNotificationClosed, updateScrollPosition: handleUpdateScrollPosition, copyToClipboard: copyToClipboard, - copyLinkUrl: copyLinkUrl, isEnabledForUrl: isEnabledForUrl, saveHelpDialogSettings: saveHelpDialogSettings }; @@ -211,13 +210,6 @@ }); } - /** - * Copies url of selected link to the clipboard (wget ftw) - */ - function copyLinkUrl(request) { - Clipboard.copy(request.data); - } - function openCopiedUrlInCurrentTab(request) { openUrlInCurrentTab({ url: utils.ensureUrl(Clipboard.paste()) }); } diff --git a/linkHints.js b/linkHints.js index acdff8e7..632d16e1 100644 --- a/linkHints.js +++ b/linkHints.js @@ -216,7 +216,7 @@ var linkHints = { that.activateModeWithQueue(); }); } else if (this.shouldCopyLinkUrl) { - this.copyLinkUrl(matchedLink); + chrome.extension.sendRequest({handler: 'copyToClipboard', data: matchedLink.href}); this.deactivateMode(delay, function() { that.delayMode = false; }); } else if (this.shouldOpenInNewTab) { this.simulateClick(matchedLink); @@ -232,10 +232,6 @@ var linkHints = { } }, - copyLinkUrl: function(link) { - chrome.extension.sendRequest({handler: 'copyLinkUrl', data: link.href}); - }, - /* * Shows the marker, highlighting matchingCharCount characters. */ -- cgit v1.2.3