Display high resolution images on wykop.pl
目前為
// ==UserScript==
// @name Better wykop
// @namespace http://tampermonkey.net/
// @version 0.1.4
// @description Display high resolution images on wykop.pl
// @author You
// @match *://*.wykop.pl/*
// @grant none
// ==/UserScript==
const updateImages = () => {
const images = document.querySelectorAll('img');
if (images) {
images.forEach((image) => {
const lowQualitySrc = image.getAttribute('src') || ''
// image.style['max-height'] = `${image.height}px`
image.style['max-width'] = `${image.width}px`
image.setAttribute(
'src',
lowQualitySrc
.replace(',q40', '')
.replace(',w400', '')
.replace(',w113h64', '')
.replace(',w207h139', '')
.replace(',w300h223', '')
)
})
}
}
(() => {
document.onreadystatechange = () => {
if (document.readyState === 'complete') {
setTimeout(() => {
document.addEventListener('click', updateImages)
updateImages()
}, 500)
}
};
})()