1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-16 23:42:39 +01:00

Chrome: browserAction-related code-review

This commit is contained in:
Chris 2015-05-01 04:43:43 -06:00
parent 84aad79ad7
commit c2741e07f0

View File

@ -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);