Skip to content

Commit 2b63dcd

Browse files
committed
[mv3] Force register content scripts when none are found
Possibly will fix cases of no content scripts found in Safari. Related issue: uBlockOrigin/uAssets#30158 (comment)
1 parent aedaa97 commit 2b63dcd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

platform/mv3/extension/js/background.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ async function startSession() {
680680
const shouldInject = isNewVersion || permissionsUpdated ||
681681
isSideloaded && rulesetConfig.developerMode;
682682
if ( shouldInject ) {
683-
registerInjectables();
683+
await registerInjectables();
684684
}
685685

686686
// Cosmetic filtering-related content scripts cache fitlering data in
@@ -730,6 +730,11 @@ async function start() {
730730
scrmgr.onWakeupRun();
731731
}
732732

733+
const scripts = await scrmgr.getRegisteredContentScripts();
734+
if ( scripts.length === 0 ) {
735+
registerInjectables();
736+
}
737+
733738
toggleDeveloperMode(rulesetConfig.developerMode);
734739
}
735740

0 commit comments

Comments
 (0)