Greasy Fork 还支持 简体中文。

Better wykop

Display high resolution images on wykop.pl

目前為 2020-03-21 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

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