From c2741e07f0221f5c77ee563cd263e8ac0a6e2562 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 1 May 2015 04:43:43 -0600 Subject: [PATCH] Chrome: browserAction-related code-review --- platform/chromium/vapi-background.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 621525347..095fb4738 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -86,6 +86,9 @@ vAPI.noTabId = '-1'; /******************************************************************************/ +// https://github.com/gorhill/uBlock/issues/101 +// chrome API expects tab id to be a number, not a string. + var toChromiumTabId = function(tabId) { if ( typeof tabId === 'string' ) { tabId = parseInt(tabId, 10); @@ -797,8 +800,8 @@ vAPI.onLoadAllCompleted = function() { chrome.browserAction.setIcon = function(x, callback) { this._setIcon({path: x.path[19], tabId: x.tabId}, callback); }; - // maybe this time... I'll win! - chrome.browserAction.setIcon({ path: iconPaths }); + // maybe this time... I'll win + chrome.browserAction.setIcon({ path: ICON_PATHS.off }); } chrome.tabs.query({ url: 'http://*/*' }, bindToTabs);