diff options
| author | Stephen Blott | 2015-02-09 15:21:54 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-02-09 15:21:54 +0000 |
| commit | 90afb58f3752d562b5c5683d170317cc5f15b42c (patch) | |
| tree | 720b97be05afe131ed02c987d0252bd86004ff9c | |
| parent | 93288e762c442f4c91ac78f810c15a9f0aac456c (diff) | |
| download | vimium-90afb58f3752d562b5c5683d170317cc5f15b42c.tar.bz2 | |
Simplify removing find-mode history for incognito mode.
| -rw-r--r-- | background_scripts/main.coffee | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index d8471b45..e15081eb 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -661,15 +661,14 @@ sendRequestHandlers = # We always remove chrome.storage.local/findModeRawQueryListIncognito on startup. chrome.storage.local.remove "findModeRawQueryListIncognito" -# Remove chrome.storage.local/findModeRawQueryListIncognito if there are no remaining incognito-mode tabs. +# Remove chrome.storage.local/findModeRawQueryListIncognito if 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) -> chrome.storage.local.get "findModeRawQueryListIncognito", (items) -> if items.findModeRawQueryListIncognito - chrome.windows.getAll { populate: true }, (windows) -> + chrome.windows.getAll null, (windows) -> for window in windows - for tab in window.tabs - return if tab.incognito and tab.id != tabId + return if window.incognito # There are no remaining incognito-mode tabs, and findModeRawQueryListIncognito is set. chrome.storage.local.remove "findModeRawQueryListIncognito" |
