1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-22 02:12:44 +01:00

Fix spurious error in content script

No guarantee vAPI.bootstrap will still be present when callback
executes.
This commit is contained in:
Raymond Hill 2024-10-04 08:57:10 -04:00
parent 9f4123a4e2
commit 5133991f7e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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) {