From ea05de3f114dcc81a91bf863538f20754641cadd Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 15 Mar 2015 13:14:26 +0000 Subject: 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. --- background_scripts/main.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'background_scripts') 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) -- cgit v1.2.3