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

  tabId = sender.tab.id
  if frameIdsForTab[tabId]?
    if request.tab_is_closing
      updateOpenTabs sender.tab
    else
      frameIdsForTab[tabId] = frameIdsForTab[tabId].filter (id) -> id != request.frameId


      selectionChangedHandlers.push(callback)
      chrome.tabs.update(toSelect.id, { selected: true })))

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
