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:
parent
9f4123a4e2
commit
5133991f7e
@ -19,8 +19,6 @@
|
|||||||
Home: https://github.com/gorhill/uBlock
|
Home: https://github.com/gorhill/uBlock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// If content scripts are already injected, we need to respond with `false`,
|
// If content scripts are already injected, we need to respond with `false`,
|
||||||
// to "should inject content scripts?"
|
// to "should inject content scripts?"
|
||||||
//
|
//
|
||||||
@ -31,7 +29,7 @@
|
|||||||
try {
|
try {
|
||||||
const status = vAPI.uBO !== true;
|
const status = vAPI.uBO !== true;
|
||||||
if ( status === false && vAPI.bootstrap ) {
|
if ( status === false && vAPI.bootstrap ) {
|
||||||
self.requestIdleCallback(( ) => vAPI && vAPI.bootstrap());
|
self.requestIdleCallback(( ) => vAPI?.bootstrap());
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
} catch(ex) {
|
} catch(ex) {
|
||||||
|
Loading…
Reference in New Issue
Block a user