Mind that attribute names are case-insensitive

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/3121
This commit is contained in:
Raymond Hill 2024-02-14 08:37:01 -05:00
parent b22b3d729b
commit 50ebfb9932
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 3 additions and 1 deletions

View File

@ -3844,7 +3844,9 @@ function setAttr(
const before = elem.getAttribute(attr);
const after = extractValue(elem);
if ( after === before ) { continue; }
if ( attr.startsWith('on') && attr in elem && after !== '' ) { continue; }
if ( after !== '' && /^on/i.test(attr) ) {
if ( attr.toLowerCase() in elem ) { continue; }
}
elem.setAttribute(attr, after);
safe.uboLog(logPrefix, `${attr}="${after}"`);
}