diff options
| author | Stephen Blott | 2015-02-08 14:13:38 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-02-08 14:13:38 +0000 |
| commit | 7b451aaca8d8c84aab77ac262753c6239b466791 (patch) | |
| tree | 723775dc8df19cd3fc8c578045f10b2e34f009b7 | |
| parent | 3af220b4b26d10e87db2a3caf734dd3a4139a378 (diff) | |
| download | vimium-7b451aaca8d8c84aab77ac262753c6239b466791.tar.bz2 | |
Push fond-mode queries from incognito-mode tabs to other incognito tabs.
| -rw-r--r-- | background_scripts/main.coffee | 7 | ||||
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 4 |
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 = -> |
