aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-03-17 09:18:52 +0000
committerStephen Blott2015-03-17 09:18:52 +0000
commitefada88f419933c5bd1478faada3b4eff3082103 (patch)
treed65543b704ed2da6545c89bf1996ff7c84e02e78 /background_scripts/main.coffee
parent1ae621489da091e6d9430da248d0e6eaab606f35 (diff)
downloadvimium-efada88f419933c5bd1478faada3b4eff3082103.tar.bz2
Activate vomnibar in window.top; refocus original frame.
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee10
1 files changed, 10 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index fe6cc70b..f031eeaf 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -658,6 +658,15 @@ handleFrameFocused = (request, sender) ->
frameIdsForTab[tabId] =
[request.frameId, (frameIdsForTab[tabId].filter (id) -> id != request.frameId)...]
+# Send a message to a frame (in the sender's tab). The sender should set:
+# - request.targetFrameId (the target frame)
+# - request.name (the name of the handler in the target frame, e.g. "focusFrame")
+# In addition, request.senderFrameId will be set to the frameId of the sender.
+sendMessageToFrame = (request, sender) ->
+ request.senderFrameId = request.frameId
+ request.frameId = request.targetFrameId
+ chrome.tabs.sendMessage sender.tab.id, request
+
# Port handler mapping
portHandlers =
keyDown: handleKeyDown,
@@ -685,6 +694,7 @@ sendRequestHandlers =
createMark: Marks.create.bind(Marks)
gotoMark: Marks.goto.bind(Marks)
setBadge: setBadge
+ sendMessageToFrame: sendMessageToFrame
# We always remove chrome.storage.local/findModeRawQueryListIncognito on startup.
chrome.storage.local.remove "findModeRawQueryListIncognito"