aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-04-02 06:00:01 +0100
committerStephen Blott2016-04-02 06:00:04 +0100
commita0cd21a2bd75fa9706d897fbfc2334ecf4d77963 (patch)
treeb50d74f811e782e25b6d4c9dc7b9fef64286a457 /background_scripts/main.coffee
parent9e6c2c36b4f53c5dc1029e4d7992311cdb55e0f7 (diff)
downloadvimium-a0cd21a2bd75fa9706d897fbfc2334ecf4d77963.tar.bz2
topFramePortForTab is no longer needed.
We use portsForTab[0] instead.
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee6
1 files changed, 2 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 5c795348..663871de 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -22,7 +22,6 @@ currentVersion = Utils.getCurrentVersion()
frameIdsForTab = {}
portsForTab = {}
root.urlForTab = {}
-topFramePortForTab = {}
# This is exported for use by "marks.coffee".
root.tabLoadedHandlers = {} # tabId -> function()
@@ -291,7 +290,6 @@ for icon in [ENABLED_ICON, DISABLED_ICON, PARTIAL_ICON]
Frames =
onConnect: (sender, port) ->
[tabId, frameId] = [sender.tab.id, sender.frameId]
- topFramePortForTab[tabId] = port if frameId == 0
frameIdsForTab[tabId] ?= []
frameIdsForTab[tabId].push frameId unless frameId in frameIdsForTab[tabId]
portsForTab[tabId] ?= {}
@@ -335,7 +333,7 @@ Frames =
delete tabLoadedHandlers[tabId]
initializeTopFrameUIComponents: ({tabId}) ->
- topFramePortForTab[tabId].postMessage handler: "initializeTopFrameUIComponents"
+ portsForTab[tabId][0]?.postMessage handler: "initializeTopFrameUIComponents"
handleFrameFocused = ({tabId, frameId}) ->
frameIdsForTab[tabId] ?= []
@@ -411,7 +409,7 @@ chrome.storage.local.remove "findModeRawQueryListIncognito"
# there are no remaining incognito-mode windows. Since the common case is that there are none to begin with,
# we first check whether the key is set at all.
chrome.tabs.onRemoved.addListener (tabId) ->
- delete cache[tabId] for cache in [frameIdsForTab, urlForTab, topFramePortForTab, portsForTab]
+ delete cache[tabId] for cache in [frameIdsForTab, urlForTab, portsForTab]
chrome.storage.local.get "findModeRawQueryListIncognito", (items) ->
if items.findModeRawQueryListIncognito
chrome.windows.getAll null, (windows) ->