1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-06 09:37:12 +02:00

fixed Chromium API complaining of invalid tabId

This commit is contained in:
gorhill 2015-04-12 18:32:35 -04:00
parent 4023d0cd84
commit 2cc5fb3b19

View File

@ -208,6 +208,9 @@ vAPI.tabs.get = function(tabId, callback) {
if ( typeof tabId === 'string' ) {
tabId = parseInt(tabId, 10);
}
if ( typeof tabId !== 'number' || isNaN(tabId) ) {
onTabReady(null);
}
chrome.tabs.get(tabId, onTabReady);
return;
}