[mv3] Code review last commit

Related commit:
2076d42239
This commit is contained in:
Raymond Hill 2025-05-23 09:49:07 -04:00
parent 2076d42239
commit 93d8e639ce
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -612,22 +612,24 @@ async function registerInjectables() {
if ( toRemove.length !== 0 ) {
ubolLog(`Unregistered ${toRemove} content (css/js)`);
await browser.scripting.unregisterContentScripts({ ids: toRemove }).then(( ) => {
try {
await browser.scripting.unregisterContentScripts({ ids: toRemove });
localRemove('$scripting.unregisterContentScripts');
}).catch(reason => {
} catch(reason) {
localWrite('$scripting.unregisterContentScripts', reason);
console.info(reason);
});
}
}
if ( toAdd.length !== 0 ) {
ubolLog(`Registered ${toAdd.map(v => v.id)} content (css/js)`);
await browser.scripting.registerContentScripts(toAdd).then(( ) => {
try {
await browser.scripting.registerContentScripts(toAdd);
localRemove('$scripting.registerContentScripts');
}).catch(reason => {
} catch(reason) {
localWrite('$scripting.registerContentScripts', reason);
console.info(reason);
});
}
}
registerInjectables.barrier = false;