summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-09-09 18:51:38 +0200
committerWojtek Kosior <koszko@koszko.org>2021-09-09 18:51:38 +0200
commited9cc030ec7992b3f59d155067a3ebff6c9e1faa (patch)
tree31bf4a131955f9c8f7563919f82230d94d378e34
parent44e89d8ec71b441a431c848567f34b9a36f6b982 (diff)
downloadbrowser-extension-ed9cc030ec7992b3f59d155067a3ebff6c9e1faa.tar.gz
browser-extension-ed9cc030ec7992b3f59d155067a3ebff6c9e1faa.zip
restore compatibility with IceCat 60
-rw-r--r--content/main.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/content/main.js b/content/main.js
index a26f72d..cc7692a 100644
--- a/content/main.js
+++ b/content/main.js
@@ -243,10 +243,11 @@ function mozilla_initial_block(doc)
{
doc.addEventListener("beforescriptexecute", prevent_script_execution);
- [...doc.all].flatMap(ele => [...ele.attributes].map(attr => [ele, attr]))
- .map(([ele, attr]) => [ele, attr.localName])
- .filter(([ele, attr]) => /^on/.test(attr) && ele.wrappedJSObject[attr])
- .forEach(([ele, attr]) => ele.wrappedJSObject[attr] = null);
+ for (const elem of doc.querySelectorAll("*")) {
+ [...elem.attributes].map(attr => attr.localName)
+ .filter(attr => /^on/.test(attr) && elem.wrappedJSObject[attr])
+ .forEach(attr => elem.wrappedJSObject[attr] = null);
+ }
}
/*