summaryrefslogtreecommitdiff
path: root/src/content
diff options
context:
space:
mode:
authorhackademix2018-09-09 14:58:55 +0200
committerhackademix2018-09-09 14:58:55 +0200
commit1cfb3117efbe2f41494155719fec0ce16960790c (patch)
tree2c622d852de53feee8d94c9639c7859cb8fe2cc7 /src/content
parent002c8f8b67f863bb62eee5a9c8244ff42d890067 (diff)
downloadnoscript-1cfb3117efbe2f41494155719fec0ce16960790c.tar.gz
noscript-1cfb3117efbe2f41494155719fec0ce16960790c.tar.xz
noscript-1cfb3117efbe2f41494155719fec0ce16960790c.zip
Prevent multiple CSP entries to be injected in the DOM on each reload if scripting is disabled.
Diffstat (limited to 'src/content')
-rw-r--r--src/content/DocumentCSP.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/content/DocumentCSP.js b/src/content/DocumentCSP.js
index 63f5d1e..7632ce7 100644
--- a/src/content/DocumentCSP.js
+++ b/src/content/DocumentCSP.js
@@ -26,10 +26,8 @@ class DocumentCSP {
try {
parent.insertBefore(meta, parent.firstChild);
debug(`Failsafe <meta> CSP inserted in the DOM: "%s"`, header.value);
- if (capabilities.has("script")) {
- meta.remove();
- if (!head) parent.remove();
- }
+ meta.remove();
+ if (!head) parent.remove();
} catch (e) {
error(e, "Error inserting CSP %s in the DOM", header && header.value);
}