From 74be882452a1ee0826cb4f1c0c18b617fe987823 Mon Sep 17 00:00:00 2001 From: blankie Date: Wed, 22 Mar 2023 21:41:22 +0700 Subject: [PATCH] Update Image Loader Placeholder Remover to 1.6 - Add support for www.bleepingcomputer.com --- Image Loader Placeholder Remover.user.js | 27 +++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/Image Loader Placeholder Remover.user.js b/Image Loader Placeholder Remover.user.js index 548a901..b5bf1da 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.5 +// @version 1.6 // @author blankie // @run-at document-end // @description Removes image loading placeholders @@ -141,6 +141,30 @@ function theautopian() { } } +// https://www.bleepingcomputer.com/ +// https://www.bleepingcomputer.com/news/microsoft/windows-11-snipping-tool-privacy-bug-exposes-cropped-image-content/ +function bleepingcomputer() { + for (element of document.querySelectorAll(".b-lazy")) { + const addLink = element.parentNode.tagName !== "A"; + const dataSrc = element.getAttribute("data-src"); + if (dataSrc === null) { + return; + } + + const url = new URL(dataSrc, location); + if (addLink) { + const newElement = element.cloneNode(); + newElement.src = url.href; + const wrapper = document.createElement("a"); + wrapper.href = url.href; + wrapper.appendChild(newElement); + element.replaceWith(wrapper); + } else { + element.src = url.href; + } + } +} + switch (location.host) { case "closeronline.co.uk": closeronline(); break; case "www.indiatoday.in": indiatoday(); break; @@ -148,5 +172,6 @@ switch (location.host) { case "www.pcgamer.com": pcgamer(); break; case "www.wired.com": wired(); break; case "www.theautopian.com": theautopian(); break; + case "www.bleepingcomputer.com": bleepingcomputer(); break; default: wordpress(); break; }; \ No newline at end of file