From a0cd21a2bd75fa9706d897fbfc2334ecf4d77963 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 2 Apr 2016 06:00:01 +0100 Subject: topFramePortForTab is no longer needed. We use portsForTab[0] instead. --- background_scripts/main.coffee | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'background_scripts/main.coffee') 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) -> -- cgit v1.2.3