diff options
| author | Stephen Blott | 2015-02-09 08:55:47 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2015-02-09 08:55:47 +0000 | 
| commit | 88f6eab0908ee05e67f4883ca3419681e7de39ef (patch) | |
| tree | 472c61d367fdf7b6305198c2cd4185c0e422ef6a | |
| parent | 8991e7b16bdee88195851db8832707fc256e53fc (diff) | |
| download | vimium-88f6eab0908ee05e67f4883ca3419681e7de39ef.tar.bz2 | |
Propagate queries to incognito-mode tabs.
| -rw-r--r-- | background_scripts/settings.coffee | 1 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 14 | 
2 files changed, 11 insertions, 4 deletions
| diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee index 7430145c..f43bd4bc 100644 --- a/background_scripts/settings.coffee +++ b/background_scripts/settings.coffee @@ -116,6 +116,7 @@ root.Settings = Settings =      settingsVersion: Utils.getCurrentVersion() +  # We use settingsVersion to coordinate any necessary schema changes.  if Utils.compareVersions("1.42", Settings.get("settingsVersion")) != -1    Settings.set("scrollStepSize", parseFloat Settings.get("scrollStepSize")) diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 9a50d373..06eaf334 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -551,16 +551,16 @@ FindModeHistory =        @key = "findModeRawQueryListIncognito" if isIncognitoMode        @storage.get @key, (items) =>          unless chrome.runtime.lastError -          @rawQueryList = items[@key] -          if isIncognitoMode and not @rawQueryList -            # This is the first incognito tab, we need to initialize the incognito-mode query history. +          @rawQueryList = items[@key] if 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                  @rawQueryList = items.findModeRawQueryList                  @storage.set findModeRawQueryListIncognito: @rawQueryList      chrome.storage.onChanged.addListener (changes, area) => -      @rawQueryList = changes[@key].newValue if changes[@key]?.newValue? +      @rawQueryList = changes[@key].newValue if changes[@key]?    getQuery: (index = 0) ->      @rawQueryList?[index] or "" @@ -570,6 +570,12 @@ FindModeHistory =        @rawQueryList = ([ query ].concat @rawQueryList.filter (q) => q != query)[0..@max]        newSetting = {}; newSetting[@key] = @rawQueryList        @storage.set newSetting +      # Now, check whether we need to propagte this query to incognito mode too. +      unless isIncognitoMode +        @storage.get "findModeRawQueryListIncognito", (items) => +          if not chrome.runtime.lastError and items.findModeRawQueryListIncognito +            rawQueryList = ([ query ].concat items.findModeRawQueryListIncognito.filter (q) => q != query)[0..@max] +            @storage.set findModeRawQueryListIncognito: rawQueryList  # should be called whenever rawQuery is modified.  updateFindModeQuery = -> | 
