From 5133991f7e04ee3ad20dba2c42491c85f10438ea Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 4 Oct 2024 08:57:10 -0400 Subject: [PATCH] Fix spurious error in content script No guarantee vAPI.bootstrap will still be present when callback executes. --- src/js/scriptlets/should-inject-contentscript.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/js/scriptlets/should-inject-contentscript.js b/src/js/scriptlets/should-inject-contentscript.js index 94d0cd3f1..df3378a88 100644 --- a/src/js/scriptlets/should-inject-contentscript.js +++ b/src/js/scriptlets/should-inject-contentscript.js @@ -19,8 +19,6 @@ Home: https://github.com/gorhill/uBlock */ -'use strict'; - // If content scripts are already injected, we need to respond with `false`, // to "should inject content scripts?" // @@ -31,7 +29,7 @@ try { const status = vAPI.uBO !== true; if ( status === false && vAPI.bootstrap ) { - self.requestIdleCallback(( ) => vAPI && vAPI.bootstrap()); + self.requestIdleCallback(( ) => vAPI?.bootstrap()); } return status; } catch(ex) {