mirror of https://github.com/gorhill/uBlock.git
fixed Chromium API complaining of invalid tabId
This commit is contained in:
parent
4023d0cd84
commit
2cc5fb3b19
|
@ -208,6 +208,9 @@ vAPI.tabs.get = function(tabId, callback) {
|
||||||
if ( typeof tabId === 'string' ) {
|
if ( typeof tabId === 'string' ) {
|
||||||
tabId = parseInt(tabId, 10);
|
tabId = parseInt(tabId, 10);
|
||||||
}
|
}
|
||||||
|
if ( typeof tabId !== 'number' || isNaN(tabId) ) {
|
||||||
|
onTabReady(null);
|
||||||
|
}
|
||||||
chrome.tabs.get(tabId, onTabReady);
|
chrome.tabs.get(tabId, onTabReady);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue