Work-around for background page misteriously being unloaded sometimes by Firefox.

This commit is contained in:
hackademix 2022-12-04 09:55:45 +01:00
parent 72ea5eafb4
commit c4607bd6c6
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
1 changed files with 6 additions and 1 deletions

View File

@ -90,7 +90,12 @@ var UI = (() => {
debug("Imported", Policy);
},
async pullSettings() {
Messages.send("broadcastSettings", {tabId: UI.tabId});
try {
Messages.send("broadcastSettings", {tabId: UI.tabId});
} catch (e) {
// brutal work-around for background page misteriously being unloaded sometimes by Firefox
browser.runtime.reload();
}
},
async updateSettings({policy, xssUserChoices, unrestrictedTab, local, sync, reloadAffected, command}) {
if (policy) policy = policy.dry(true);