diff options
author | hackademix | 2018-09-09 14:58:55 +0200 |
---|---|---|
committer | hackademix | 2018-09-09 14:58:55 +0200 |
commit | 1cfb3117efbe2f41494155719fec0ce16960790c (patch) | |
tree | 2c622d852de53feee8d94c9639c7859cb8fe2cc7 /src | |
parent | 002c8f8b67f863bb62eee5a9c8244ff42d890067 (diff) | |
download | noscript-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')
-rw-r--r-- | src/content/DocumentCSP.js | 6 |
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); } |