From 126ec0e11d928be286fca16a0bdfa55fc36d55a9 Mon Sep 17 00:00:00 2001 From: tophf Date: Thu, 21 May 2015 18:39:39 +0300 Subject: [PATCH] Use transparent badge color when not in disableAll state Works because Chrome *overlays* user-specified badge color onto its own default color. --- messaging.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/messaging.js b/messaging.js index 874b7542..cfe9fbd8 100644 --- a/messaging.js +++ b/messaging.js @@ -16,11 +16,6 @@ function notifyAllTabs(request) { chrome.extension.sendMessage(reqPopup); } -var defaultBadgeColor = "red"; -chrome.browserAction.getBadgeBackgroundColor({}, function(color) { - defaultBadgeColor = color; -}); - function updateIcon(tab, styles) { // while NTP is still loading only process the request for its main frame with a real url // (but when it's loaded we should process style toggle requests from popups, for example) @@ -61,7 +56,7 @@ function updateIcon(tab, styles) { }); var t = prefs.getPref("show-badge") && styles.length ? ("" + styles.length) : ""; chrome.browserAction.setBadgeText({text: t, tabId: tab.id}); - chrome.browserAction.setBadgeBackgroundColor({color: disableAll ? "#aaa" : defaultBadgeColor}); + chrome.browserAction.setBadgeBackgroundColor({color: disableAll ? "#aaa" : [0, 0, 0, 0]}); //console.log("Tab " + tab.id + " (" + tab.url + ") badge text set to '" + t + "'."); } }