diff options
| author | Stephen Blott | 2016-02-27 16:05:23 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-05 05:37:40 +0000 |
| commit | 6487c09d98b791b3211679d2f1bf970394a696e6 (patch) | |
| tree | 0af7e0b9aa282e3ee733bb6f477de6cc8d3d5227 /content_scripts | |
| parent | 320dfd5419b4a7e676f8690a87b275b305440dc3 (diff) | |
| download | vimium-6487c09d98b791b3211679d2f1bf970394a696e6.tar.bz2 | |
Key bindings; rewire vomnibar.
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 10 | ||||
| -rw-r--r-- | content_scripts/vomnibar.coffee | 1 |
2 files changed, 4 insertions, 7 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 0cb402b8..4acac352 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -120,7 +120,6 @@ window.initializeModes = -> You have asked Vimium to perform #{count} repeats of the command: #{registryEntry.description}.\n Are you sure you want to continue? """ - # TODO: Special handling of Vomnibar. if registryEntry.isBackgroundCommand chrome.runtime.sendMessage { handler: "runBackgroundCommand", frameId, registryEntry, count} else @@ -136,6 +135,9 @@ window.initializeModes = -> new InsertMode permanent: true Scroller.init() +openVomnibar = ({sourceFrameId, registryEntry}) -> + Utils.invokeCommandString registryEntry.command, [sourceFrameId, registryEntry] if DomUtils.isTopFrame() + # # Complete initialization work that sould be done prior to DOMReady. # @@ -151,6 +153,7 @@ initializePreDomReady = -> # A frame has received the focus. We don't care here (the Vomnibar/UI-component handles this). frameFocused: -> checkEnabledAfterURLChange: checkEnabledAfterURLChange + openVomnibar: openVomnibar chrome.runtime.onMessage.addListener (request, sender, sendResponse) -> # In the options page, we will receive requests from both content and background scripts. ignore those @@ -162,11 +165,6 @@ initializePreDomReady = -> shouldHandleRequest = isEnabledForUrl # We always handle the message if it's one of these listed message types. shouldHandleRequest ||= request.name in [ "checkEnabledAfterURLChange" ] - # Requests with a frameId of zero should always and only be handled in the main/top frame (regardless of - # whether Vimium is enabled there). - if request.frameId == 0 and DomUtils.isTopFrame() - request.frameId = frameId - shouldHandleRequest = true sendResponse requestHandlers[request.name](request, sender) if shouldHandleRequest # Ensure the sendResponse callback is freed. false diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 55a46777..67a79ff4 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -7,7 +7,6 @@ Vomnibar = # Parse any additional options from the command's registry entry. Currently, this only includes a flag of # the form "keyword=X", for direct activation of a custom search engine. parseRegistryEntry: (registryEntry = { options: [] }, callback = null) -> - options = {} searchEngines = Settings.get("searchEngines") ? "" SearchEngines.refreshAndUse searchEngines, (engines) -> callback? registryEntry.options |
