[mv3] Avoid re-entrance when registering content scripts

This commit is contained in:
Raymond Hill 2025-03-15 13:29:26 -04:00
parent 4d12ac788c
commit c3187d85e8
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -495,11 +495,12 @@ function registerScriptlet(context, scriptletDetails) {
/******************************************************************************/
async function registerInjectables(origins) {
void origins;
async function registerInjectables() {
if ( browser.scripting === undefined ) { return false; }
if ( registerInjectables.barrier ) { return true; }
registerInjectables.barrier = true;
const [
filteringModeDetails,
rulesetsDetails,
@ -548,6 +549,8 @@ async function registerInjectables(origins) {
.catch(reason => { console.info(reason); });
}
registerInjectables.barrier = false;
return true;
}