mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01: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:
parent
c95da8f5c5
commit
bf99623a54
1 changed files with 3 additions and 1 deletions
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue