aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/main.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-03-15 13:14:26 +0000
committerStephen Blott2015-03-15 13:14:26 +0000
commitea05de3f114dcc81a91bf863538f20754641cadd (patch)
tree2154957bdc84c8639012a934c952c777e6a35ef7 /background_scripts/main.coffee
parent3876a4f06de77d190fdaecc6cf99eb57134d0372 (diff)
downloadvimium-ea05de3f114dcc81a91bf863538f20754641cadd.tar.bz2
Propagate exclusion rules to all frames.
When the active tab changes, we call updateActiveState to update the icon and propagate any changed exclusion-rule state to the tab. All frames received the request. However, only one response is received by the background page. Therefore, new exclusion rules are only propagated to one frame. Here's what can go wrong... On gmail, open the hangouts frame. Add an exclusion rule sepcific to the hangouts frame. Save it. The update is propagated only to the main frame. The new exclusion rule is not in effect in the hangouts frame. That's wierd and obviously wrong. In this commit, every frame receiving the getActiveState request also calls checkIfEnabledForUrl to ensure that any new exclusion-rule state is propagated. This is overkill, to some extent. We should really move settings to chrome.storage and have each frame check locally for changes affecting it.
Diffstat (limited to 'background_scripts/main.coffee')
-rw-r--r--background_scripts/main.coffee3
1 files changed, 2 insertions, 1 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee
index ecf18bef..a5d7ac31 100644
--- a/background_scripts/main.coffee
+++ b/background_scripts/main.coffee
@@ -398,7 +398,8 @@ root.updateActiveState = updateActiveState = (tabId) ->
if response
isCurrentlyEnabled = response.enabled
currentPasskeys = response.passKeys
- config = isEnabledForUrl { url: tab.url }, { tab: tab }
+ currentURL = response.url
+ config = isEnabledForUrl { url: currentURL }, { tab: tab }
enabled = config.isEnabledForUrl
passKeys = config.passKeys
if (enabled and passKeys)