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'); + } +);