summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content/policy_enforcing.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/content/policy_enforcing.js b/content/policy_enforcing.js
index 0b74de9..f6f4081 100644
--- a/content/policy_enforcing.js
+++ b/content/policy_enforcing.js
@@ -213,7 +213,12 @@ function sanitize_tree_urls(root) {
#IF MOZILLA
function sanitize_element_onevent(element) {
- for (const attribute_node of (element.attributes || [])) {
+ if (element.haketilo_sanitized_onevent)
+ return;
+
+ element.haketilo_sanitized_onevent = true;
+
+ for (const attribute_node of [...(element.attributes || [])]) {
const attr = attribute_node.localName, attr_lo = attr.toLowerCase();;
if (!/^on/.test(attr_lo) || !(attr_lo in element.wrappedJSObject))
continue;