From c4607bd6c601bbad369d60082612ea36830fef78 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sun, 4 Dec 2022 09:55:45 +0100 Subject: [PATCH] Work-around for background page misteriously being unloaded sometimes by Firefox. --- src/ui/ui.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/ui.js b/src/ui/ui.js index 98332ea..1830f20 100644 --- a/src/ui/ui.js +++ b/src/ui/ui.js @@ -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);