diff options
| -rw-r--r-- | background_scripts/commands.coffee | 14 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 5 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 6 | 
3 files changed, 13 insertions, 12 deletions
| diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 25acdc03..4dbcd1cd 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -381,13 +381,13 @@ commandDescriptions =    moveTabRight: ["Move tab to the right", { background: true, passCountToFunction: true  }]    # These are background-page commands because all requests go via the background page. -  "Vomnibar.activate": ["Open URL, bookmark, or history entry", { background: true, noRepeat: true }] -  "Vomnibar.activateInNewTab": ["Open URL, bookmark, history entry, in a new tab", { background: true, noRepeat: true }] -  "Vomnibar.activateTabSelection": ["Search through your open tabs", { background: true, noRepeat: true }] -  "Vomnibar.activateBookmarks": ["Open a bookmark", { background: true, noRepeat: true }] -  "Vomnibar.activateBookmarksInNewTab": ["Open a bookmark in a new tab", { background: true, noRepeat: true }] -  "Vomnibar.activateEditUrl": ["Edit the current URL", { background: true, noRepeat: true }] -  "Vomnibar.activateEditUrlInNewTab": ["Edit the current URL and open in a new tab", { background: true, noRepeat: true }] +  "Vomnibar.activate": ["Open URL, bookmark, or history entry", { noRepeat: true }] +  "Vomnibar.activateInNewTab": ["Open URL, bookmark, history entry, in a new tab", { noRepeat: true }] +  "Vomnibar.activateTabSelection": ["Search through your open tabs", { noRepeat: true }] +  "Vomnibar.activateBookmarks": ["Open a bookmark", { noRepeat: true }] +  "Vomnibar.activateBookmarksInNewTab": ["Open a bookmark in a new tab", { noRepeat: true }] +  "Vomnibar.activateEditUrl": ["Edit the current URL", { noRepeat: true }] +  "Vomnibar.activateEditUrlInNewTab": ["Edit the current URL and open in a new tab", { noRepeat: true }]    nextFrame: ["Cycle forward to the next frame on the page", { background: true, passCountToFunction: true }]    mainFrame: ["Select the tab's main/top frame", { background: true, noRepeat: true }] diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 614b74c0..49199cae 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -370,10 +370,7 @@ chrome.tabs.onUpdated.addListener (tabId, changeInfo, tab) ->  # End action functions  runBackgroundCommand = ({frameId, registryEntry, count}, sender) -> -  if registryEntry.command.startsWith "Vomnibar." -    chrome.tabs.sendMessage sender.tab.id, -      name: "openVomnibar", sourceFrameId: frameId, registryEntry: registryEntry -  else if registryEntry.passCountToFunction +  if registryEntry.passCountToFunction      BackgroundCommands[registryEntry.command] count, frameId    else if registryEntry.noRepeat      BackgroundCommands[registryEntry.command] frameId diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 01b02985..72be5510 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -116,7 +116,11 @@ class NormalMode extends KeyHandlerMode          You have asked Vimium to perform #{count} repetitions of the command: #{registryEntry.description}.\n          Are you sure you want to continue?""" -    if registryEntry.isBackgroundCommand +    # The Vomnibar needs special handling because it is always activated in the tab's main frame. +    if registryEntry.command.startsWith "Vomnibar." +      chrome.runtime.sendMessage +        handler: "sendMessageToFrames", message: {name: "openVomnibar", sourceFrameId: frameId, registryEntry} +    else if registryEntry.isBackgroundCommand        chrome.runtime.sendMessage {handler: "runBackgroundCommand", frameId, registryEntry, count}      else if registryEntry.passCountToFunction        Utils.invokeCommandString registryEntry.command, [count] | 
