mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-05 18:32:30 +01:00
Chrome: browserAction-related code-review
This commit is contained in:
parent
84aad79ad7
commit
c2741e07f0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user