Update Image Loader Placeholder Remover to 1.16.2

- Fix support for URLs that start with ./ or ../
This commit is contained in:
blankie 2023-08-12 21:24:29 +10:00
parent f733e10bda
commit 62cbadd1ae
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 4 additions and 2 deletions

View File

@ -3,7 +3,7 @@
// @namespace blankie-scripts
// @match http*://*/*
// @grant none
// @version 1.16.1
// @version 1.16.2
// @author blankie
// @run-at document-end
// @description Removes image loading placeholders
@ -12,7 +12,9 @@
"use strict";
function isUrlLike(url) {
return url && /^(?:\/|https?:\/\/)\S+$/.test(url);
// Example of ./path:
// - https://projects.apnews.com/features/2023/missing-students-chronic-absenteeism/index.html
return url && /^(?:https?:\/\/|\.{0,2}\/)\S+$/.test(url);
}
function findUrl(element) {
if (window.location.host === "www.vice.com") {