diff options
| author | Stephen Blott | 2015-04-25 07:06:31 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-04-25 07:06:31 +0100 |
| commit | 9100b1d48aa9c09d792d9e2c9251e6a6c62f81bf (patch) | |
| tree | e005bacd529ec8efa63243b45225051fc9af3417 /background_scripts | |
| parent | ef44d0ff49cec17a758b65c10ba4c0ecbc0c2ece (diff) | |
| parent | bfa6c88b41acac4c98d06f324f25f8bb7b328614 (diff) | |
| download | vimium-9100b1d48aa9c09d792d9e2c9251e6a6c62f81bf.tar.bz2 | |
Merge branch 'vomnibar-in-main-window' into vomnibar-in-main-window-merge
Conflicts:
background_scripts/main.coffee
content_scripts/vimium_frontend.coffee
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/main.coffee | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 31ada357..a26fd8a8 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -600,6 +600,18 @@ handleFrameFocused = (request, sender) -> if frameIdsForTab[tabId]? frameIdsForTab[tabId] = [request.frameId, (frameIdsForTab[tabId].filter (id) -> id != request.frameId)...] + # Inform all frames that a frame has received the focus. + chrome.tabs.sendMessage sender.tab.id, + name: "frameFocused" + focusFrameId: request.frameId + +# Send a message to all frames in the current tab. +sendMessageToFrames = (request, sender) -> + chrome.tabs.sendMessage sender.tab.id, request.message + +# For debugging only. This allows content scripts to log messages to the background page's console. +bgLog = (request, sender) -> + console.log "#{sender.tab.id}/#{request.frameId}", request.message # Port handler mapping portHandlers = @@ -627,6 +639,8 @@ sendRequestHandlers = createMark: Marks.create.bind(Marks) gotoMark: Marks.goto.bind(Marks) setIcon: setIcon + sendMessageToFrames: sendMessageToFrames + log: bgLog # We always remove chrome.storage.local/findModeRawQueryListIncognito on startup. chrome.storage.local.remove "findModeRawQueryListIncognito" |
