aboutsummaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRaymond Hill <rhill@raymondhill.net>2014-11-20 23:18:33 -0200
committerRaymond Hill <rhill@raymondhill.net>2014-11-20 23:18:33 -0200
commit33969e8b2e5a6d9c42ef06ba5d2bc0e37bca3e54 (patch)
tree9c60975769cd24e5722b73cfd0d05dada82aa1e7 /meta
parent94e56350532ad775e0861ad67277078ac846db42 (diff)
downloaduBlock-33969e8b2e5a6d9c42ef06ba5d2bc0e37bca3e54.zip
uBlock-33969e8b2e5a6d9c42ef06ba5d2bc0e37bca3e54.tar.gz
uBlock-33969e8b2e5a6d9c42ef06ba5d2bc0e37bca3e54.tar.bz2
more spurious warnings in console foiled
Diffstat (limited to 'meta')
-rw-r--r--meta/crx/vapi-background.js16
1 files changed, 13 insertions, 3 deletions
diff --git a/meta/crx/vapi-background.js b/meta/crx/vapi-background.js
index 875930c..ccbe85d 100644
--- a/meta/crx/vapi-background.js
+++ b/meta/crx/vapi-background.js
@@ -69,11 +69,22 @@ vAPI.tabs.registerListeners = function() {
/******************************************************************************/
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;
+ }
+ callback(tab);
+ }
if ( tabId !== null ) {
- chrome.tabs.get(tabId, callback);
+ 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]);
};
chrome.tabs.query({ active: true, currentWindow: true }, onTabReceived);
@@ -181,8 +192,7 @@ vAPI.tabs.remove = function(tabId) {
vAPI.tabs.injectScript = function(tabId, details, callback) {
var onScriptExecuted = function() {
- // Must check `lastError` or else this may happen in the console:
- // Unchecked runtime.lastError while running tabs.executeScript: The tab was closed.
+ // https://code.google.com/p/chromium/issues/detail?id=410868#c8
if ( chrome.runtime.lastError ) {
}
if ( typeof callback === 'function' ) {