Skip to content

Commit ab705e3

Browse files
committed
More robust initialization sequence.
1 parent a2f6bcb commit ab705e3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/bg/RequestGuard.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@
818818
};
819819

820820
async function injectPolicyScript(details) {
821+
await ns.initializing;
821822
const {url, tabId, frameId} = details;
822823
const domPolicy = await ns.computeChildPolicy({url}, {tab: {id: tabId}, frameId});
823824
domPolicy.navigationURL = url;

src/bg/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199
},
200200

201201
async fetchChildPolicy({url, contextUrl}, sender) {
202-
await ns.initializing;
203202
return await ns.computeChildPolicy(...arguments);
204203
},
205204

@@ -306,6 +305,7 @@
306305
},
307306

308307
async computeChildPolicy({url, contextUrl}, sender) {
308+
await ns.initializing;
309309
let {tab} = sender;
310310
let policy = ns.policy;
311311
const {isTorBrowser} = ns.local;

0 commit comments

Comments
 (0)