From 9c7fd70d5716afdad88630de1a13975019f0bef4 Mon Sep 17 00:00:00 2001 From: hackademix Date: Mon, 14 Feb 2022 18:50:02 +0100 Subject: [PATCH] Always use correct context when setting CSP headers. --- src/bg/RequestGuard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js index 833a14e..2b32a54 100644 --- a/src/bg/RequestGuard.js +++ b/src/bg/RequestGuard.js @@ -536,7 +536,7 @@ var RequestGuard = (() => { let capabilities; if (ns.isEnforced(tabId)) { let policy = ns.policy; - let perms = policy.get(url, documentUrl).perms; + let {perms} = policy.get(url, ns.policyContext(request)); if (isMainFrame) { if (policy.autoAllowTop && perms === policy.DEFAULT) { policy.set(Sites.optimalKey(url), perms = policy.TRUSTED.tempTwin);