diff --git a/background.js b/background.js index 7824a56..edbe7a6 100644 --- a/background.js +++ b/background.js @@ -201,10 +201,9 @@ window.dark_object = { } let selectorText = image.tagName+`[data-ud-selector='${image.getAttribute("data-ud-selector")}']`; let notableInfos = {}; - for (const attributeName of image.getAttributeNames()) { - let infoValue = image.getAttribute(attributeName); - if (infoValue.length > 0 && !(/[.\/]/i).test(infoValue) && !(["src","data", "data-ud-selector"]).includes(attributeName)) { - notableInfos[attributeName] = infoValue; + for (const attribute of image.attributes) { + if (attribute.value.length > 0 && !(/[.\/]/i).test(attribute.value) && !(["src","data", "data-ud-selector"]).includes(attribute.name)) { + notableInfos[attribute.name] = attribute.value; } } if (imageTrueSrc.includes(uDark.imageSrcInfoMarker)) { @@ -799,8 +798,15 @@ window.dark_object = { restoreTemplateElements: function(aDocument) { // Restore