diff options
| author | Stephen Blott | 2016-03-15 12:42:43 +0000 |
|---|---|---|
| committer | Stephen Blott | 2016-03-17 11:17:03 +0000 |
| commit | 8912215c01504b459ff1c6aa17309a86037f6af8 (patch) | |
| tree | f3322e126b3e6caa0d63c3aebc4586f56b1b044c /background_scripts | |
| parent | 4009213f0dbe1326263535e0a50a165d179ae47d (diff) | |
| download | vimium-8912215c01504b459ff1c6aa17309a86037f6af8.tar.bz2 | |
Fix omission from 3768b54aa1ac12cdd809e7108a6a9fd629a1164f.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/main.coffee | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 634acc60..f6e70d3a 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -381,6 +381,7 @@ Frames = onConnect: (sender, port) -> [tabId, frameId] = [sender.tab.id, sender.frameId] # We always add frameId 0, the top frame, automatically, and never unregister it. + frameIdsForTab[tabId]? frameIdsForTab[tabId] ?= [0] frameIdsForTab[tabId].push frameId unless frameId == 0 port.postMessage name: "registerFrameId", chromeFrameId: frameId @@ -391,14 +392,14 @@ Frames = # then we'll tidy up in the chrome.tabs.onRemoved listener, below. This approach avoids any dependency # on the order in which register and unregister events happens (on navigation, a new top frame # registering before the old one is deregistered). - if tabId of frameIdsForTab and tabId != 0 + if tabId of frameIdsForTab and frameId != 0 frameIdsForTab[tabId] = frameIdsForTab[tabId].filter (fId) -> fId != frameId port.onDisconnect.removeListener listener handleFrameFocused = (request, sender) -> [tabId, frameId] = [sender.tab.id, sender.frameId] # This might be the first time we've heard from this tab. - frameIdsForTab[tabId] ?= [] + frameIdsForTab[tabId] ?= [0] # Cycle frameIdsForTab to the focused frame. frameIdsForTab[tabId] = cycleToFrame frameIdsForTab[tabId], frameId # Inform all frames that a frame has received the focus. |
