As the tag names are often uppercase, and so this was overly strict
and didn't always match correctly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
} else if ((name === 'href' || name === 'src') && !_isHTTPLike(value)) {
try {
let url = new URL(value, window.location.origin);
- if (_isHTTPLike(url.protocol) || (node.tagName === 'img' && url.protocol === 'data:')) {
+ if (
+ _isHTTPLike(url.protocol) ||
+ (node.tagName.toLowerCase() === 'img' && url.protocol.toLowerCase() === 'data:')
+ ) {
node.attributes[i].value = url.href;
} else {
node.attributes.removeNamedItem(name);