diff options
| author | mrmr1993 | 2015-06-02 16:57:11 +0100 |
|---|---|---|
| committer | mrmr1993 | 2015-06-10 17:21:23 +0100 |
| commit | 36fe16dcafd57484bf4219262c67cc5612bad722 (patch) | |
| tree | c0873cab7c9ffe28f8d5d2be99196f4f37dac685 | |
| parent | 673cd268223cdbf1c8ecd47a5826291a91b955d6 (diff) | |
| download | vimium-36fe16dcafd57484bf4219262c67cc5612bad722.tar.bz2 | |
Make FindModeHistory independent of the rest of vimium_frontend
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index e5a0f61a..295736c6 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -630,15 +630,16 @@ window.FindModeHistory = key: "findModeRawQueryList" max: 50 rawQueryList: null + isIncognitoMode: chrome.extension.inIncognitoContext init: -> unless @rawQueryList @rawQueryList = [] # Prevent repeated initialization. - @key = "findModeRawQueryListIncognito" if isIncognitoMode + @key = "findModeRawQueryListIncognito" if @isIncognitoMode @storage.get @key, (items) => unless chrome.runtime.lastError @rawQueryList = items[@key] if items[@key] - if isIncognitoMode and not items[@key] + if @isIncognitoMode and not items[@key] # This is the first incognito tab, so we need to initialize the incognito-mode query history. @storage.get "findModeRawQueryList", (items) => unless chrome.runtime.lastError @@ -657,7 +658,7 @@ window.FindModeHistory = newSetting = {}; newSetting[@key] = @rawQueryList @storage.set newSetting # If there are any active incognito-mode tabs, then propagte this query to those tabs too. - unless isIncognitoMode + unless @isIncognitoMode @storage.get "findModeRawQueryListIncognito", (items) => if not chrome.runtime.lastError and items.findModeRawQueryListIncognito @storage.set |
