From c8d984520f5de4b3e702cee992c7ecc4f4f49435 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 28 Feb 2015 06:37:01 +0000 Subject: Make badges tab specific. Fixes #1491. --- background_scripts/main.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 9eafc2a2..8b13621e 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -349,14 +349,14 @@ chrome.browserAction.setBadgeBackgroundColor setBadge = do -> current = null timer = null - updateBadge = (badge) -> -> chrome.browserAction.setBadgeText text: badge - (request) -> + updateBadge = (badge, tabId) -> -> chrome.browserAction.setBadgeText text: badge, tabId: tabId + (request, sender) -> badge = request.badge if badge? and badge != current current = badge clearTimeout timer if timer # We wait a few moments. This avoids badge flicker when there are rapid changes. - timer = setTimeout updateBadge(badge), 50 + timer = setTimeout updateBadge(badge, sender.tab.id), 50 # Updates the browserAction icon to indicate whether Vimium is enabled or disabled on the current page. # Also propagates new enabled/disabled/passkeys state to active window, if necessary. -- cgit v1.2.3