aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932015-02-12 11:03:51 +0000
committermrmr19932015-02-12 11:03:51 +0000
commit647ee056d2390b1950dc9a72b7ee789d801201ea (patch)
treeb95b5685bc887412ec066c2676b9122939447c71
parent51a4748f80490e0433c5387171fb28b88adf0ea5 (diff)
downloadvimium-647ee056d2390b1950dc9a72b7ee789d801201ea.tar.bz2
Retain frame data for a tab unless the top frame tells us its closing
-rw-r--r--background_scripts/main.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index e15081eb..66a4f25e 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -324,7 +324,7 @@ selectTab = (callback, direction) ->
selectionChangedHandlers.push(callback)
chrome.tabs.update(toSelect.id, { selected: true })))
-updateOpenTabs = (tab) ->
+updateOpenTabs = (tab, deleteFrames = false) ->
# Chrome might reuse the tab ID of a recently removed tab.
if tabInfoMap[tab.id]?.deletor
clearTimeout tabInfoMap[tab.id].deletor
@@ -336,7 +336,7 @@ updateOpenTabs = (tab) ->
scrollY: null
deletor: null
# Frames are recreated on refresh
- delete frameIdsForTab[tab.id]
+ delete frameIdsForTab[tab.id] if deleteFrames
setBrowserActionIcon = (tabId,path) ->
chrome.browserAction.setIcon({ tabId: tabId, path: path })
@@ -619,7 +619,7 @@ unregisterFrame = (request, sender) ->
tabId = sender.tab.id
if frameIdsForTab[tabId]?
if request.tab_is_closing
- updateOpenTabs sender.tab
+ updateOpenTabs sender.tab, true
else
frameIdsForTab[tabId] = frameIdsForTab[tabId].filter (id) -> id != request.frameId