diff --git a/platform/mv3/extension/js/scripting-manager.js b/platform/mv3/extension/js/scripting-manager.js index 810d0cae0..4b0b0d592 100644 --- a/platform/mv3/extension/js/scripting-manager.js +++ b/platform/mv3/extension/js/scripting-manager.js @@ -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;