diff --git a/Image Loader Placeholder Remover.user.js b/Image Loader Placeholder Remover.user.js index 32d9c95..4af0157 100644 --- a/Image Loader Placeholder Remover.user.js +++ b/Image Loader Placeholder Remover.user.js @@ -3,7 +3,7 @@ // @namespace blankie-scripts // @match http*://*/* // @grant none -// @version 1.17.1 +// @version 1.18.0 // @author blankie // @run-at document-end // @description Removes image loading placeholders @@ -306,4 +306,34 @@ if (window.location.host === "www.wikihow.com") { video.controls = 1; 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); + } + } } \ No newline at end of file