aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/commands.coffee14
-rw-r--r--content_scripts/vimium_frontend.coffee7
2 files changed, 10 insertions, 11 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index c13a09ba..55cb60d2 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -376,13 +376,13 @@ commandDescriptions =
moveTabLeft: ["Move tab to the left", { background: true, passCountToFunction: true }]
moveTabRight: ["Move tab to the right", { background: true, passCountToFunction: 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 }]
+ "Vomnibar.activate": ["Open URL, bookmark, or history entry", { topFrame: true }]
+ "Vomnibar.activateInNewTab": ["Open URL, bookmark, history entry, in a new tab", { topFrame: true }]
+ "Vomnibar.activateTabSelection": ["Search through your open tabs", { topFrame: true }]
+ "Vomnibar.activateBookmarks": ["Open a bookmark", { topFrame: true }]
+ "Vomnibar.activateBookmarksInNewTab": ["Open a bookmark in a new tab", { topFrame: true }]
+ "Vomnibar.activateEditUrl": ["Edit the current URL", { topFrame: true }]
+ "Vomnibar.activateEditUrlInNewTab": ["Edit the current URL and open in a new tab", { topFrame: 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/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 71535b19..972911c5 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -116,10 +116,9 @@ 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?"""
- # The Vomnibar needs special handling because it is always activated in the tab's main frame.
- if registryEntry.command.startsWith "Vomnibar."
+ if registryEntry.topFrame
chrome.runtime.sendMessage
- handler: "sendMessageToFrames", message: {name: "openVomnibar", sourceFrameId: frameId, registryEntry}
+ handler: "sendMessageToFrames", message: {name: "runInTopFrame", sourceFrameId: frameId, registryEntry}
else if registryEntry.background
chrome.runtime.sendMessage {handler: "runBackgroundCommand", frameId, registryEntry, count}
else if registryEntry.passCountToFunction
@@ -150,7 +149,7 @@ initializePreDomReady = ->
# A frame has received the focus. We don't care here (the Vomnibar/UI-component handles this).
frameFocused: ->
checkEnabledAfterURLChange: checkEnabledAfterURLChange
- openVomnibar: ({sourceFrameId, registryEntry}) ->
+ runInTopFrame: ({sourceFrameId, registryEntry}) ->
Utils.invokeCommandString registryEntry.command, [sourceFrameId, registryEntry] if DomUtils.isTopFrame()
chrome.runtime.onMessage.addListener (request, sender, sendResponse) ->