aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts')
-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) ->