diff options
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index cb70db9a..0d33b7f7 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -366,6 +366,9 @@ root.updateActiveState = updateActiveState = (tabId) -> disabledIcon = "icons/browser_action_disabled.png" partialIcon = "icons/browser_action_partial.png" chrome.tabs.get tabId, (tab) -> + # Default to disabled state in case we can't connect to Vimium, primarily for the "New Tab" page. + setBrowserActionIcon(tabId,disabledIcon) + setBadge badge: "" chrome.tabs.sendMessage tabId, { name: "getActiveState" }, (response) -> if response isCurrentlyEnabled = response.enabled @@ -382,10 +385,7 @@ root.updateActiveState = updateActiveState = (tabId) -> # Propagate the new state only if it has changed. if (isCurrentlyEnabled != enabled || currentPasskeys != passKeys) chrome.tabs.sendMessage(tabId, { name: "setState", enabled: enabled, passKeys: passKeys, incognito: tab.incognito }) - else - # We didn't get a response from the front end, so Vimium isn't running. - setBrowserActionIcon(tabId,disabledIcon) - setBadge {badge: ""} + handleUpdateScrollPosition = (request, sender) -> updateScrollPosition(sender.tab, request.scrollX, request.scrollY) |
