mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-06-14 00:05:08 +12:00
this fixes #455
This commit is contained in:
parent
2a108917b5
commit
ed30222601
|
@ -86,18 +86,22 @@ vAPI.tabs.get = function(tabId, callback) {
|
|||
var onTabReady = function(tab) {
|
||||
// https://code.google.com/p/chromium/issues/detail?id=410868#c8
|
||||
if ( chrome.runtime.lastError ) {
|
||||
return;
|
||||
;
|
||||
}
|
||||
// Caller must be prepared to deal with nil tab value
|
||||
callback(tab);
|
||||
};
|
||||
if ( tabId !== null ) {
|
||||
if ( typeof tabId === 'string' ) {
|
||||
tabId = parseInt(tabId, 10);
|
||||
}
|
||||
chrome.tabs.get(tabId, onTabReady);
|
||||
return;
|
||||
}
|
||||
var onTabReceived = function(tabs) {
|
||||
// https://code.google.com/p/chromium/issues/detail?id=410868#c8
|
||||
if ( chrome.runtime.lastError ) {
|
||||
return;
|
||||
;
|
||||
}
|
||||
callback(tabs[0]);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue