diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index 6d229130d..b6bbbf0a6 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -31,8 +31,17 @@ /******************************************************************************/ +// https://github.com/gorhill/uBlock/issues/464 +if ( document instanceof HTMLDocument === false ) { + return false; +} + +if ( !vAPI ) { + return; +} + if ( vAPI.canExecuteContentScript() !== true ) { - throw "uBlock> contentscript-end.js > Skipping " + location.protocol; + return; } // https://github.com/gorhill/uBlock/issues/456 diff --git a/src/js/contentscript-start.js b/src/js/contentscript-start.js index 2432562c2..ab95b3427 100644 --- a/src/js/contentscript-start.js +++ b/src/js/contentscript-start.js @@ -34,6 +34,11 @@ /******************************************************************************/ +// https://github.com/gorhill/uBlock/issues/464 +if ( document instanceof HTMLDocument === false ) { + return false; +} + // Because in case if ( !vAPI ) { return;