[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:
Raymond Hill 2022-09-28 10:20:57 -04:00
parent de0f45581c
commit a20273c582
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 7 deletions

View File

@ -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;
}