summaryrefslogtreecommitdiff
path: root/background
diff options
context:
space:
mode:
Diffstat (limited to 'background')
-rw-r--r--background/policy_injector.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/background/policy_injector.js b/background/policy_injector.js
index a67b4e3..90c65bd 100644
--- a/background/policy_injector.js
+++ b/background/policy_injector.js
@@ -108,7 +108,7 @@ function headers_inject(details)
delete csp['report-to'];
delete csp['report-uri'];
- if (!target.policy.allow) {
+ if (!targets.policy.allow) {
delete csp['script-src'];
delete csp['script-src-elem'];
csp['script-src-attr'] = ["'none'"];
@@ -118,12 +118,12 @@ function headers_inject(details)
if ('script-src' in csp)
csp['script-src'].push(rule);
else
- csp['script-src'] = rule;
+ csp['script-src'] = [rule];
if ('script-src-elem' in csp)
csp['script-src-elem'].push(rule);
else
- csp['script-src-elem'] = rule;
+ csp['script-src-elem'] = [rule];
/* TODO: is this safe */
let new_policy = Object.entries(csp).map(