Don't try to convert to an absolute img url when the img url is already absolute. Issue #1726

This commit is contained in:
Maurice Parker 2020-01-28 15:39:02 -07:00
parent 6d8d828fd2
commit c6beb3c9dd

View File

@ -22,12 +22,12 @@ function stripStyles() {
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => stripStylesFromElement(element, ["color", "background", "font"]));
}
// Convert all Feedbin proxy images to be used as src, otherwise change image locations to be absolute
// Convert all Feedbin proxy images to be used as src, otherwise change image locations to be absolute if not already
function convertImgSrc() {
document.querySelectorAll("img").forEach(element => {
if (element.hasAttribute("data-canonical-src")) {
element.src = element.getAttribute("data-canonical-src")
} else {
} else if (!element.src.match(/^[a-z]+\:\/\//i)) {
element.src = new URL(element.src, document.baseURI).href;
}
});