Better wykop

Display high resolution images on wykop.pl

当前为 2020-03-21 提交的版本,查看 最新版本

// ==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)
        }
    };
})()

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址