Skip to content

Commit 5133991

Browse files
committed
Fix spurious error in content script
No guarantee vAPI.bootstrap will still be present when callback executes.
1 parent 9f4123a commit 5133991

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/js/scriptlets/should-inject-contentscript.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
Home: https://github.com/gorhill/uBlock
2020
*/
2121

22-
'use strict';
23-
2422
// If content scripts are already injected, we need to respond with `false`,
2523
// to "should inject content scripts?"
2624
//
@@ -31,7 +29,7 @@
3129
try {
3230
const status = vAPI.uBO !== true;
3331
if ( status === false && vAPI.bootstrap ) {
34-
self.requestIdleCallback(( ) => vAPI && vAPI.bootstrap());
32+
self.requestIdleCallback(( ) => vAPI?.bootstrap());
3533
}
3634
return status;
3735
} catch(ex) {

0 commit comments

Comments
 (0)