Update Image Loader Placeholder Remover to 1.18.0
- Add explicit support for www.forbes.com
This commit is contained in:
parent
127b846b67
commit
169205b341
|
@ -3,7 +3,7 @@
|
||||||
// @namespace blankie-scripts
|
// @namespace blankie-scripts
|
||||||
// @match http*://*/*
|
// @match http*://*/*
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 1.17.1
|
// @version 1.18.0
|
||||||
// @author blankie
|
// @author blankie
|
||||||
// @run-at document-end
|
// @run-at document-end
|
||||||
// @description Removes image loading placeholders
|
// @description Removes image loading placeholders
|
||||||
|
@ -307,3 +307,33 @@ if (window.location.host === "www.wikihow.com") {
|
||||||
video.src = `/video${video.dataset.src}`;
|
video.src = `/video${video.dataset.src}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://www.forbes.com/
|
||||||
|
// https://www.forbes.com/sites/ewanspence/2023/08/30/fairphone-5-preview-android-sustainable-repairable-modular-android/
|
||||||
|
if (window.location.host === "www.forbes.com") {
|
||||||
|
for (let progressiveImage of document.querySelectorAll("progressive-image")) {
|
||||||
|
let url = progressiveImage.getAttribute("src") || progressiveImage.getAttribute("background-image");;
|
||||||
|
|
||||||
|
let img = document.createElement("img");
|
||||||
|
for (let attr of progressiveImage.attributes) {
|
||||||
|
img.setAttribute(attr.name, attr.value);
|
||||||
|
}
|
||||||
|
img.src = url;
|
||||||
|
img.append(...progressiveImage.childNodes);
|
||||||
|
|
||||||
|
let placeholder = progressiveImage.closest(".image-embed__placeholder");
|
||||||
|
if (placeholder) {
|
||||||
|
placeholder.style.height = "auto";
|
||||||
|
placeholder.style.paddingTop = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!progressiveImage.closest("a")) {
|
||||||
|
let wrapper = document.createElement("a");
|
||||||
|
wrapper.href = url;
|
||||||
|
wrapper.append(img);
|
||||||
|
progressiveImage.replaceWith(wrapper);
|
||||||
|
} else {
|
||||||
|
progressiveImage.replaceWith(img);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue