Update Image Loader Placeholder Remover to 1.21.0

- Remove empty srcsets
This commit is contained in:
blankie 2023-09-12 20:01:25 +10:00
parent 77b73718a6
commit 29d26e7153
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 6 additions and 1 deletions

View File

@ -3,7 +3,7 @@
// @namespace blankie-scripts // @namespace blankie-scripts
// @match http*://*/* // @match http*://*/*
// @grant none // @grant none
// @version 1.20.0 // @version 1.21.0
// @author blankie // @author blankie
// @run-at document-end // @run-at document-end
// @description Removes image loading placeholders // @description Removes image loading placeholders
@ -316,6 +316,11 @@ function removePlaceholder(img) {
if (url) { if (url) {
img.src = url; img.src = url;
} }
// Example of an empty srcset:
// https://blog.jwf.io/2020/04/open-source-minecraft-bukkit-gpl/
if (img.srcset && !srcset) {
img.srcset = "";
}
// apparently, remaining <source>s can fuck up image rendering (firefox still thinks that the <img> contains an empty image?) // apparently, remaining <source>s can fuck up image rendering (firefox still thinks that the <img> contains an empty image?)
// https://gizmodo.com/reddit-news-blackout-protest-is-finally-over-reddit-won-1850707509 // https://gizmodo.com/reddit-news-blackout-protest-is-finally-over-reddit-won-1850707509