1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-14 15:02:27 +02:00

Add sanity checks

In rare circumstances, it's possible the content
script lose access to the background page, best
to check against this to avoid spurious console
errors.
This commit is contained in:
Raymond Hill 2019-09-29 12:26:58 -04:00
parent c95da8f5c5
commit bf99623a54
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -148,6 +148,7 @@ vAPI.SafeAnimationFrame = function(callback) {
vAPI.SafeAnimationFrame.prototype = {
start: function(delay) {
if ( vAPI instanceof Object === false ) { return; }
if ( delay === undefined ) {
if ( this.fid === undefined ) {
this.fid = requestAnimationFrame(( ) => { this.onRAF(); } );
@ -1454,7 +1455,8 @@ vAPI.bootstrap = (function() {
// to try bootstrapping again later.
const bootstrapPhase1 = function(response) {
if ( response === null ) { return; }
if ( response instanceof Object === false ) { return; }
vAPI.bootstrap = undefined;
// cosmetic filtering engine aka 'cfe'