Update Image Loader Placeholder Remover to 1.10.0
- Add support for blog.joshumax.me
This commit is contained in:
parent
4cb86951c2
commit
b46abcaf81
|
@ -3,7 +3,7 @@
|
||||||
// @namespace blankie-scripts
|
// @namespace blankie-scripts
|
||||||
// @match http*://*/*
|
// @match http*://*/*
|
||||||
// @grant none
|
// @grant none
|
||||||
// @version 1.8
|
// @version 1.10.0
|
||||||
// @author blankie
|
// @author blankie
|
||||||
// @run-at document-end
|
// @run-at document-end
|
||||||
// @description Removes image loading placeholders
|
// @description Removes image loading placeholders
|
||||||
|
@ -193,6 +193,25 @@ function vulcan() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://blog.joshumax.me/general/2021/08/11/running-doom-on-captioncall.html
|
||||||
|
function joshumax() {
|
||||||
|
for (let element of document.querySelectorAll("img[data-src]")) {
|
||||||
|
const addLink = element.parentNode.tagName !== "A";
|
||||||
|
const url = new URL(element.getAttribute("data-src"), 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) {
|
switch (location.host) {
|
||||||
case "closeronline.co.uk": closeronline(); break;
|
case "closeronline.co.uk": closeronline(); break;
|
||||||
case "www.indiatoday.in": indiatoday(); break;
|
case "www.indiatoday.in": indiatoday(); break;
|
||||||
|
@ -203,5 +222,6 @@ switch (location.host) {
|
||||||
case "www.bleepingcomputer.com": bleepingcomputer(); break;
|
case "www.bleepingcomputer.com": bleepingcomputer(); break;
|
||||||
case "securelist.com": securelist(); break;
|
case "securelist.com": securelist(); break;
|
||||||
case "vulcan.io": vulcan(); break;
|
case "vulcan.io": vulcan(); break;
|
||||||
|
case "blog.joshumax.me": joshumax(); break;
|
||||||
default: wordpress(); break;
|
default: wordpress(); break;
|
||||||
};
|
};
|
Loading…
Reference in New Issue