mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
parent
2076d42239
commit
93d8e639ce
1 changed files with 8 additions and 6 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue