diff options
author | hackademix | 2018-09-04 19:48:07 +0200 |
---|---|---|
committer | hackademix | 2018-09-04 19:48:07 +0200 |
commit | 1814bfa03d090e7f0de7c68124c83fa3adacbfa5 (patch) | |
tree | 93c2ec4320638596427ce82c4f7b2088e94f8c35 /src/content/content.js | |
parent | 26470b84f681b7db9e500bb4503eab7b8b202879 (diff) | |
download | noscript-1814bfa03d090e7f0de7c68124c83fa3adacbfa5.tar.gz noscript-1814bfa03d090e7f0de7c68124c83fa3adacbfa5.tar.xz noscript-1814bfa03d090e7f0de7c68124c83fa3adacbfa5.zip |
Work-around for CSP not being honored when the HEAD element has not been inserted yet.
Diffstat (limited to 'src/content/content.js')
-rw-r--r-- | src/content/content.js | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/content/content.js b/src/content/content.js index fb68ae4..302ee8a 100644 --- a/src/content/content.js +++ b/src/content/content.js @@ -83,19 +83,7 @@ ns.on("capabilities", () => { }); if (!ns.canScript) { - addEventListener("beforescriptexecute", e => e.preventDefault()); - let mo = new MutationObserver(mutations => { - for (let m of mutations) { - console.log(`Mutation `, m); - if (m.type !== "attribute") continue; - if (/^on\w+/i.test(m.attributeName)) { - m.target.removeAttribute(m.attributeName); - } else if (/^\s*(javascript|data):/i.test(m.target.attributes[m.attributeName])) { - m.target.setAttribute(m.attributeName, "#"); - } - } - }); - // mo.observe(document.documentElement, {attributes: true, subtree: true}); + if ("serviceWorker" in navigator && navigator.serviceWorker.controller) { (async () => { for (let r of await navigator.serviceWorker.getRegistrations()) { |