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/vimium_frontend.coffee | |
| parent | 320dfd5419b4a7e676f8690a87b275b305440dc3 (diff) | |
| download | vimium-6487c09d98b791b3211679d2f1bf970394a696e6.tar.bz2 | |
Key bindings; rewire vomnibar.
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 10 |
1 files changed, 4 insertions, 6 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 |
