aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-02-27 16:05:23 +0000
committerStephen Blott2016-03-05 05:37:40 +0000
commit6487c09d98b791b3211679d2f1bf970394a696e6 (patch)
tree0af7e0b9aa282e3ee733bb6f477de6cc8d3d5227 /background_scripts
parent320dfd5419b4a7e676f8690a87b275b305440dc3 (diff)
downloadvimium-6487c09d98b791b3211679d2f1bf970394a696e6.tar.bz2
Key bindings; rewire vomnibar.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/commands.coffee14
-rw-r--r--background_scripts/main.coffee11
2 files changed, 17 insertions, 8 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 7e02047c..a62c674e 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -374,13 +374,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", { 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 }]
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 60c161f9..8d2b4248 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -369,7 +369,16 @@ chrome.tabs.onUpdated.addListener (tabId, changeInfo, tab) ->
# End action functions
-runBackgroundCommand = ({frameId, registryEntry, count}) ->
+# Open Vomnibar in tab's main frame.
+openVomnibar = (tabId, frameId, registryEntry) ->
+ chrome.tabs.sendMessage tabId,
+ name: "openVomnibar"
+ sourceFrameId: frameId
+ registryEntry: registryEntry
+
+runBackgroundCommand = ({frameId, registryEntry, count}, sender) ->
+ if registryEntry.command.split(".")[0] == "Vomnibar"
+ openVomnibar sender.tab.id, frameId, registryEntry
if registryEntry.passCountToFunction
BackgroundCommands[registryEntry.command] count, frameId
else if registryEntry.noRepeat