Close UI and reload immediately when enabling global/tab restrictions or disabling them for the tab only.

This commit is contained in:
hackademix 2022-02-26 23:51:38 +01:00
parent 41f9fcb8f4
commit 804782ef0c
1 changed files with 10 additions and 0 deletions

View File

@ -195,6 +195,11 @@ addEventListener("unload", e => {
this.disabled = true;
policy.enforced = !pressed;
await UI.updateSettings({policy, reloadAffected: false});
if (policy.enforced || UI.local.immediateUnrestrict) {
reload();
close();
return;
}
setupEnforcement();
pendingReload(true);
};
@ -216,6 +221,11 @@ addEventListener("unload", e => {
reloadAffected: false,
});
UI.unrestrictedTab = pressed;
if (!(UI.unrestrictedTab && UI.local.stickyUnrestrictedTab)) {
reload();
close();
return;
}
setupEnforcement();
pendingReload(true);
}