Don't try to convert to an absolute img url when the img url is already absolute. Issue #1726
This commit is contained in:
parent
6d8d828fd2
commit
c6beb3c9dd
@ -22,12 +22,12 @@ function stripStyles() {
|
|||||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => stripStylesFromElement(element, ["color", "background", "font"]));
|
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() {
|
function convertImgSrc() {
|
||||||
document.querySelectorAll("img").forEach(element => {
|
document.querySelectorAll("img").forEach(element => {
|
||||||
if (element.hasAttribute("data-canonical-src")) {
|
if (element.hasAttribute("data-canonical-src")) {
|
||||||
element.src = element.getAttribute("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;
|
element.src = new URL(element.src, document.baseURI).href;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user