aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-02-08 14:13:38 +0000
committerStephen Blott2015-02-08 14:13:38 +0000
commit7b451aaca8d8c84aab77ac262753c6239b466791 (patch)
tree723775dc8df19cd3fc8c578045f10b2e34f009b7 /background_scripts
parent3af220b4b26d10e87db2a3caf734dd3a4139a378 (diff)
downloadvimium-7b451aaca8d8c84aab77ac262753c6239b466791.tar.bz2
Push fond-mode queries from incognito-mode tabs to other incognito tabs.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/main.coffee7
1 files changed, 5 insertions, 2 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