Convert all image locations to be absolute. Issues #954 & 1280
This commit is contained in:
parent
f687fc96a6
commit
8a69657b54
|
@ -14,6 +14,13 @@ function stripStyles() {
|
||||||
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => element.removeAttribute("style"));
|
document.getElementsByTagName("body")[0].querySelectorAll("[style]").forEach(element => element.removeAttribute("style"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert all image locations to be absolute
|
||||||
|
function convertImgSrc() {
|
||||||
|
document.querySelectorAll("img").forEach(element => {
|
||||||
|
element.src = new URL(element.src, document.baseURI).href;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function error() {
|
function error() {
|
||||||
document.body.innerHTML = "error";
|
document.body.innerHTML = "error";
|
||||||
}
|
}
|
||||||
|
@ -26,5 +33,7 @@ function render(data) {
|
||||||
|
|
||||||
wrapFrames()
|
wrapFrames()
|
||||||
stripStyles()
|
stripStyles()
|
||||||
|
convertImgSrc()
|
||||||
|
|
||||||
postRenderProcessing()
|
postRenderProcessing()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue