aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/main.coffee7
-rw-r--r--content_scripts/vimium_frontend.coffee4
2 files changed, 7 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index 65b97aff..54e0491b 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -188,7 +188,7 @@ handleSettings = (args, port) ->
value = Settings.get(args.key)
port.postMessage({ key: args.key, value: value })
else # operation == "set"
- Settings.set(args.key, args.value)
+ Settings.set(args.key, args.value) unless args.incognito and args.key in [ "findModeRawQueryList" ]
# For some settings, we propagate changes to all tabs immediately.
# In the case of findModeRawQueryList, this allows each tab to accurately track the find-mode history.
if args.key in [ "findModeRawQueryList" ]
@@ -593,12 +593,15 @@ checkKeyQueue = (keysToCheck, tabId, frameId) ->
#
# Message all tabs. Args should be the arguments hash used by the Chrome sendRequest API.
+# Normally, the request is sent to all tabs. However, if args.incognito is set, then the request is only sent
+# to incognito tabs.
#
sendRequestToAllTabs = (args) ->
chrome.windows.getAll({ populate: true }, (windows) ->
for window in windows
for tab in window.tabs
- chrome.tabs.sendMessage(tab.id, args, null))
+ if not args.incognito or tab.incognito
+ chrome.tabs.sendMessage(tab.id, args, null))
#
# Returns true if the current extension version is greater than the previously recorded version in
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 218869e9..b9737ffd 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -74,7 +74,7 @@ settings =
@init() unless @port
@values[key] = value
- @port.postMessage({ operation: "set", key: key, value: value })
+ @port.postMessage({ operation: "set", key: key, value: value, incognito: isIncognitoMode })
load: ->
@init() unless @port
@@ -575,7 +575,7 @@ FindModeHistory =
saveQuery: (query) ->
if 0 < query.length
@updateRawQueryList query
- settings.set "findModeRawQueryList", @rawQueryList unless isIncognitoMode
+ settings.set "findModeRawQueryList", @rawQueryList
# should be called whenever rawQuery is modified.
updateFindModeQuery = ->