diff options
-rw-r--r-- | content/main.js | 9 |
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); + } } /* |