Actually use the show-badge preference

This commit is contained in:
9adefaf01e5bf6426d838cd20eae582d2b6ba647 2015-03-04 21:43:03 +03:00 committed by tophf
parent 74d83e2640
commit 0ff7537a8d

View File

@ -13,7 +13,7 @@ function webNavigationListener(method, data) {
getStyles({matchUrl: data.url, enabled: true, asHash: true}, function(styleHash) {
chrome.tabs.sendMessage(data.tabId, {method: method, styles: styleHash});
// Don't show the badge for frames
if (data.frameId == 0) {
if (data.frameId == 0 && prefs.getPref("show-badge")) {
chrome.browserAction.setBadgeText({text: getBadgeText(Object.keys(styleHash)), tabId: data.tabId});
}
});