aboutsummaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-03-04 17:19:51 +0100
committerWojtek Kosior <koszko@koszko.org>2022-03-04 17:25:17 +0100
commitb43acfe39681f1a0a143e64231856a09a72f8a60 (patch)
tree01e5172ab09566f5876efbb598ef2e7b9c0718a0 /content
parent4970930c2f866133c38fa73800f1a963f0856692 (diff)
downloadbrowser-extension-b43acfe39681f1a0a143e64231856a09a72f8a60.tar.gz
browser-extension-b43acfe39681f1a0a143e64231856a09a72f8a60.zip
fix setting of 'blocked-<name>' attributes when blocking intrinsic event handlers
Diffstat (limited to 'content')
-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;