From 273a9243240d5b57b0349bdf684ae0490f38c8c0 Mon Sep 17 00:00:00 2001 From: hackademix Date: Sun, 25 Oct 2020 17:36:50 +0100 Subject: [PATCH] Fixed race condition causing temporary settings not to survive updates sometimes. --- src/bg/LifeCycle.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/bg/LifeCycle.js b/src/bg/LifeCycle.js index 90d9445..5ff74ca 100644 --- a/src/bg/LifeCycle.js +++ b/src/bg/LifeCycle.js @@ -173,10 +173,9 @@ var LifeCycle = (() => { throw new error("Ephemeral policy not found in survival tab %s!", tabId); } ns.unrestrictedTabs = new Set(unrestrictedTabs); - destroyIfNeeded(); + if (ns.initializing) await ns.initializing; ns.policy = new Policy(policy); - await ns.initializing; await Promise.all( Object.entries(allSeen).map( async ([tabId, seen]) => {