diff options
| author | Stephen Blott | 2015-02-28 06:37:01 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-02-28 06:37:56 +0000 |
| commit | c8d984520f5de4b3e702cee992c7ecc4f4f49435 (patch) | |
| tree | c9a96142ee4be59912203a479b7b55c4f3de38c2 | |
| parent | b256d8463df4a68b096bf784c9f56899a7b7e57c (diff) | |
| download | vimium-c8d984520f5de4b3e702cee992c7ecc4f4f49435.tar.bz2 | |
Make badges tab specific.
Fixes #1491.
| -rw-r--r-- | background_scripts/main.coffee | 6 |
1 files 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. |
