From c4716c3373baaf3fdc55fcd59afb279444461203 Mon Sep 17 00:00:00 2001 From: blankie Date: Fri, 4 Aug 2023 18:47:27 +1000 Subject: [PATCH] Update Image Loader Placeholder Remover to 1.15.0 - Include "placeholder" as a lazyloader class - Grab images' original URL from theconversation.com --- Image Loader Placeholder Remover.user.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Image Loader Placeholder Remover.user.js b/Image Loader Placeholder Remover.user.js index 59e57df..adcc8f0 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.14.0 +// @version 1.15.0 // @author blankie // @run-at document-end // @description Removes image loading placeholders @@ -112,7 +112,10 @@ function getLazyloaderClasses(element) { // Examples of preload: // - https://restofworld.org/ // - https://restofworld.org/2023/parent-facing-matchmaking-apps-china/ - if (className.includes("loading") || className.includes("lazy") || className.includes("responsive") || className.includes("preload")) { + // Examples of placeholder: + // - https://theconversation.com + // - https://theconversation.com/yall-that-most-southern-of-southernisms-is-going-mainstream-and-its-about-time-193265 + if (className.includes("loading") || className.includes("lazy") || className.includes("responsive") || className.includes("preload") || className.includes("placeholder")) { classes.push(className);; } } @@ -169,6 +172,10 @@ function removePlaceholder(img) { urlObject.search = ""; originalUrl = urlObject.href; img.closest(".image-container").querySelector(".image-loading").remove(); + } else if (window.location.host === "theconversation.com") { + let urlObject = new URL(url, window.location); + urlObject.search = ""; + originalUrl = urlObject.href; } img.src = url;