From ed9cc030ec7992b3f59d155067a3ebff6c9e1faa Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Thu, 9 Sep 2021 18:51:38 +0200 Subject: restore compatibility with IceCat 60 --- content/main.js | 9 +++++---- 1 file 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); + } } /* -- cgit v1.2.3