mirror of https://github.com/gorhill/uBlock.git
[mv3] Don't wait on fullfilled promise when registring scriptlets
This can interfere with user interface responsiveness when registring all scriptlets in broad-permissions mode.
This commit is contained in:
parent
de0f45581c
commit
a20273c582
|
@ -141,11 +141,9 @@ function onMessage(request, sender, callback) {
|
|||
case 'applyRulesets': {
|
||||
enableRulesets(request.enabledRulesets).then(( ) => {
|
||||
rulesetConfig.enabledRulesets = request.enabledRulesets;
|
||||
return Promise.all([
|
||||
saveRulesetConfig(),
|
||||
registerInjectables(),
|
||||
]);
|
||||
return saveRulesetConfig();
|
||||
}).then(( ) => {
|
||||
registerInjectables();
|
||||
callback();
|
||||
});
|
||||
return true;
|
||||
|
@ -188,10 +186,9 @@ function onMessage(request, sender, callback) {
|
|||
|
||||
case 'toggleTrustedSiteDirective': {
|
||||
toggleTrustedSiteDirective(request).then(response => {
|
||||
registerInjectables().then(( ) => {
|
||||
registerInjectables();
|
||||
callback(response);
|
||||
});
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue