From b43acfe39681f1a0a143e64231856a09a72f8a60 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 4 Mar 2022 17:19:51 +0100 Subject: fix setting of 'blocked-' attributes when blocking intrinsic event handlers --- content/policy_enforcing.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3