diff --git a/platform/chromium/manifest.json b/platform/chromium/manifest.json index b454c4e..67c6942 100644 --- a/platform/chromium/manifest.json +++ b/platform/chromium/manifest.json @@ -10,7 +10,7 @@ }, "browser_action": { "default_icon": { - "19": "img/browsericons/icon19-off.png" + "19": "img/browsericons/icon19-19.png" }, "default_title": "µMatrix", "default_popup": "popup.html" diff --git a/src/js/async.js b/src/js/async.js index 2f275d2..a13eb57 100644 --- a/src/js/async.js +++ b/src/js/async.js @@ -142,20 +142,19 @@ return asyncJobManager; var updateBadge = function(tabId) { delete tabIdToTimer[tabId]; - var pageStore = this.pageStoreFromTabId(tabId); - if ( pageStore === null ) { - return; - } - var iconId = null; var badgeStr = ''; - var total = pageStore.perLoadAllowedRequestCount + - pageStore.perLoadBlockedRequestCount; - if ( total ) { - var squareSize = 19; - var greenSize = squareSize * Math.sqrt(pageStore.perLoadAllowedRequestCount / total); - iconId = greenSize < squareSize/2 ? Math.ceil(greenSize) : Math.floor(greenSize); - badgeStr = this.formatCount(pageStore.distinctRequestCount); + + var pageStore = this.pageStoreFromTabId(tabId); + if ( pageStore !== null ) { + var total = pageStore.perLoadAllowedRequestCount + + pageStore.perLoadBlockedRequestCount; + if ( total ) { + var squareSize = 19; + var greenSize = squareSize * Math.sqrt(pageStore.perLoadAllowedRequestCount / total); + iconId = greenSize < squareSize/2 ? Math.ceil(greenSize) : Math.floor(greenSize); + badgeStr = this.formatCount(pageStore.distinctRequestCount); + } } vAPI.setIcon(tabId, iconId, badgeStr);