This commit is contained in:
Juhani Krekelä 2020-12-24 15:46:30 +02:00
parent 65db2beeff
commit a1ad6c0f67
1 changed files with 18 additions and 0 deletions

18
kotaku.js Normal file
View File

@ -0,0 +1,18 @@
// ==UserScript==
// @name Kotaku Image Fixer
// @version 1
// @grant none
// @match https://kotaku.com/*
// ==/UserScript==
function fixImages() {
for (let img of document.getElementsByTagName('img')) {
let srcSet = img.getAttribute('data-srcset');
if (srcSet) {
let imgUrl = srcSet.split(', ').slice(-1)[0].split(' ')[0];
img.setAttribute('src', imgUrl);
}
}
}
fixImages();