diff options
| -rw-r--r-- | background_scripts/commands.coffee | 4 | ||||
| -rw-r--r-- | content_scripts/mode_normal.coffee | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 7e171d31..4d2e1606 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -340,8 +340,8 @@ commandDescriptions = toggleViewSource: ["View page source", { noRepeat: true }] copyCurrentUrl: ["Copy the current URL to the clipboard", { noRepeat: true }] - openCopiedUrlInCurrentTab: ["Open the clipboard's URL in the current tab", { background: true, noRepeat: true }] - openCopiedUrlInNewTab: ["Open the clipboard's URL in a new tab", { background: true, repeatLimit: 20 }] + openCopiedUrlInCurrentTab: ["Open the clipboard's URL in the current tab", { noRepeat: true }] + openCopiedUrlInNewTab: ["Open the clipboard's URL in a new tab", { repeatLimit: 20 }] enterInsertMode: ["Enter insert mode", { noRepeat: true }] passNextKey: ["Pass the next key to the page"] diff --git a/content_scripts/mode_normal.coffee b/content_scripts/mode_normal.coffee index 738f009e..e91feecf 100644 --- a/content_scripts/mode_normal.coffee +++ b/content_scripts/mode_normal.coffee @@ -95,6 +95,15 @@ NormalModeCommands = url = url[0..25] + "...." if 28 < url.length HUD.showForDuration("Yanked #{url}", 2000) + openCopiedUrlInNewTab: (count) -> + HUD.pasteFromClipboard (url) -> + for i in [0...count] by 1 + chrome.runtime.sendMessage { handler: "openUrlInNewTab", url } + + openCopiedUrlInCurrentTab: -> + HUD.pasteFromClipboard (url) -> + chrome.runtime.sendMessage { handler: "openUrlInCurrentTab", url } + # Mode changes. enterInsertMode: -> # If a focusable element receives the focus, then we exit and leave the permanently-installed insert-mode |
