From 1814bfa03d090e7f0de7c68124c83fa3adacbfa5 Mon Sep 17 00:00:00 2001 From: hackademix Date: Tue, 4 Sep 2018 19:48:07 +0200 Subject: Work-around for CSP not being honored when the HEAD element has not been inserted yet. --- src/content/content.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/content/content.js') 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()) { -- cgit v1.2.3