From 744e293fb9ff65f086d06b8aeb44231db8e6331c Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 17 Mar 2016 14:02:02 +0000 Subject: Refactor setIcon to the background page. There's no need for the setting of the icon to be driven from the content script. We first know the enabled state in the background page, so set the icon there immediately. --- content_scripts/vimium_frontend.coffee | 8 -------- 1 file changed, 8 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 9a42266a..71327fb6 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -449,14 +449,6 @@ checkIfEnabledForUrl = do -> else if HUD.isReady() # Quickly hide any HUD we might already be showing, e.g. if we entered insert mode on page load. HUD.hide() - # Update the page icon, if necessary. - if windowIsFocused() - chrome.runtime.sendMessage - handler: "setIcon" - icon: - if isEnabledForUrl and not passKeys then "enabled" - else if isEnabledForUrl then "partial" - else "disabled" (frameIsFocused = windowIsFocused()) -> Frame.postMessage "isEnabledForUrl", {frameIsFocused, url: window.location.toString()} -- cgit v1.2.3