mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
[mv3] Minor code review related to permission changes
Related commit:
801b4679e9
This commit is contained in:
parent
d8fb800f30
commit
d9055b0307
1 changed files with 5 additions and 5 deletions
|
|
@ -150,7 +150,8 @@ async function onPermissionGrantedThruExtension(details, origins) {
|
|||
async function onPermissionGrantedThruBrowser(origins) {
|
||||
const modified = await syncWithBrowserPermissions();
|
||||
if ( modified === false ) { return; }
|
||||
await Promise.all([ updateSessionRules(), registerInjectables() ]);
|
||||
await registerInjectables();
|
||||
if ( rulesetConfig.autoReload !== true ) { return; }
|
||||
if ( origins.length !== 1 ) { return; }
|
||||
const tabs = await browser.tabs.query({ active: true, currentWindow: true });
|
||||
const tabId = tabs?.[0]?.id;
|
||||
|
|
@ -175,10 +176,9 @@ async function onPermissionsAdded(permissions) {
|
|||
const details = pendingPermissionRequest;
|
||||
pendingPermissionRequest = undefined;
|
||||
const { origins = [] } = permissions;
|
||||
if ( details !== undefined ) {
|
||||
return onPermissionGrantedThruExtension(details, origins);
|
||||
}
|
||||
onPermissionGrantedThruBrowser(origins);
|
||||
return details !== undefined
|
||||
? onPermissionGrantedThruExtension(details, origins)
|
||||
: onPermissionGrantedThruBrowser(origins);
|
||||
}
|
||||
|
||||
async function onPermissionsRemoved() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue