 # 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) ->

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] ?= {}

frameIdsForTab = {}
portsForTab = {}
root.urlForTab = {}

# This is exported for use by "marks.coffee".
root.tabLoadedHandlers = {} # tabId -> function()
