summaryrefslogtreecommitdiff
path: root/src/bg/RequestGuard.js
diff options
context:
space:
mode:
authorhackademix2018-08-23 17:09:26 +0200
committerhackademix2018-08-23 17:09:26 +0200
commit60c299c4f1b1abb2f494c04d6b42aa683ef0098c (patch)
tree3c53cbd303a7f8a760e0de7ee66a40566640191a /src/bg/RequestGuard.js
parent4ce026a16cc6143470a3f509b9cef2010ac24c29 (diff)
downloadnoscript-60c299c4f1b1abb2f494c04d6b42aa683ef0098c.tar.gz
noscript-60c299c4f1b1abb2f494c04d6b42aa683ef0098c.tar.xz
noscript-60c299c4f1b1abb2f494c04d6b42aa683ef0098c.zip
Update ChildPolicies when automatic temp TRUST for top-level document s is enabled.
Diffstat (limited to 'src/bg/RequestGuard.js')
-rw-r--r--src/bg/RequestGuard.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bg/RequestGuard.js b/src/bg/RequestGuard.js
index e6be19e..db34f4b 100644
--- a/src/bg/RequestGuard.js
+++ b/src/bg/RequestGuard.js
@@ -364,7 +364,7 @@ var RequestGuard = (() => {
return ALLOW;
},
- onHeadersReceived(request) {
+ async onHeadersReceived(request) {
// called for main_frame, sub_frame and object
// check for duplicate calls
@@ -389,12 +389,12 @@ var RequestGuard = (() => {
}
}
-
if (ns.isEnforced(tabId)) {
let policy = ns.policy;
let perms = policy.get(url, documentUrl).perms;
if (policy.autoAllowTop && request.type === "main_frame" && perms === policy.DEFAULT) {
policy.set(Sites.optimalKey(url), perms = policy.TRUSTED.tempTwin);
+ await ChildPolicies.update(policy);
}
let {capabilities} = perms;