mirror of https://github.com/gorhill/uBlock.git
Mind that attribute names are case-insensitive
Related issue: https://github.com/uBlockOrigin/uBlock-issues/issues/3121
This commit is contained in:
parent
b22b3d729b
commit
50ebfb9932
|
@ -3844,7 +3844,9 @@ function setAttr(
|
||||||
const before = elem.getAttribute(attr);
|
const before = elem.getAttribute(attr);
|
||||||
const after = extractValue(elem);
|
const after = extractValue(elem);
|
||||||
if ( after === before ) { continue; }
|
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);
|
elem.setAttribute(attr, after);
|
||||||
safe.uboLog(logPrefix, `${attr}="${after}"`);
|
safe.uboLog(logPrefix, `${attr}="${after}"`);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue