Skip to content

Commit b91798c

Browse files
committed
Improve freeze-element-property scriptlet
1 parent 7cd5688 commit b91798c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/js/resources/prevent-innerHTML.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,15 @@ function freezeElementProperty(
5252
const logPrefix = safe.makeLogPrefix('freeze-element-property', property, selector, pattern);
5353
const matcher = safe.initPattern(pattern, { canNegate: true });
5454
const owner = (( ) => {
55-
if ( Object.hasOwn(Element.prototype, property) ) {
56-
return Element.prototype;
55+
if ( Object.hasOwn(HTMLScriptElement.prototype, property) ) {
56+
return HTMLScriptElement.prototype;
5757
}
5858
if ( Object.hasOwn(HTMLElement.prototype, property) ) {
5959
return HTMLElement.prototype;
6060
}
61+
if ( Object.hasOwn(Element.prototype, property) ) {
62+
return Element.prototype;
63+
}
6164
if ( Object.hasOwn(Node.prototype, property) ) {
6265
return Node.prototype;
6366
}

0 commit comments

Comments
 (0)