Improve prevent-innerHTML scriptlet

Related issue:
https://github.com/uBlockOrigin/uAssets/issues/29148
This commit is contained in:
Raymond Hill 2025-07-11 08:35:10 -04:00
parent 2809b6cd18
commit b0396029bd
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -53,7 +53,7 @@ export function preventInnerHTML(
if ( typeof elem.matches !== 'function' ) { return false; }
if ( elem.matches(selector) === false ) { return false; }
}
return safe.testPattern(matcher, a);
return safe.testPattern(matcher, `${a}`);
};
Object.defineProperty(Element.prototype, 'innerHTML', {
get: function() {