From 7b451aaca8d8c84aab77ac262753c6239b466791 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 8 Feb 2015 14:13:38 +0000 Subject: Push fond-mode queries from incognito-mode tabs to other incognito tabs. --- background_scripts/main.coffee | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'background_scripts') 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 -- cgit v1.2.3