From 13b3f7bc7b6e4f50773fc7380cb6de5af55216f6 Mon Sep 17 00:00:00 2001 From: smpl Date: Sat, 24 Jul 2021 03:32:28 +0200 Subject: [PATCH] =?UTF-8?q?Tilf=C3=B8j=20GulogGratisFixListImg.user.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GulogGratisFixListImg.user.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 GulogGratisFixListImg.user.js diff --git a/GulogGratisFixListImg.user.js b/GulogGratisFixListImg.user.js new file mode 100644 index 0000000..75931d3 --- /dev/null +++ b/GulogGratisFixListImg.user.js @@ -0,0 +1,33 @@ +// ==UserScript== +// @name GulogGratisFixListImg +// @description Fiks afhængighed af eksterne JS biblioteker +// @include https://www.guloggratis.dk/* +// @version 1 +// @grant none +// ==/UserScript== + +/* Hvis man browser guloggratis.dk med nedenstående tilladelser i + * uMatrix og alt andet blokeret, så vises der ikke billeder i + * annoncelister/søgninger. + * + * * * * block + * guloggratis.dk 1st-party css allow + * guloggratis.dk 1st-party frame allow + * guloggratis.dk 1st-party image allow + * guloggratis.dk 1st-party fetch allow + * guloggratis.dk 1st-party script allow + * + * Dette brugerscript viser billederne. +*/ + +var listing = document.querySelector('div[data-inspect="search-result:listings"]'); +var images = listing.querySelectorAll('img[data-cfsrc]'); + +images.forEach( + function(e) { + e.setAttribute('src', e.getAttribute('data-cfsrc')); + e.removeAttribute('data-cfsrc'); + e.style.removeProperty('display'); + e.style.removeProperty('visibility'); + } +);