Greasy Fork

Greasy Fork is available in English.

虎扑帖子图片缩小-超轻量级

Stop social death when fishing

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         虎扑帖子图片缩小-超轻量级
// @namespace    http://tampermonkey.net/
// @version      1.3
// @license      MIT
// @description  Stop social death when fishing
// @author       sdujava2011
// @match        *://bbs.hupu.com/*
// @icon         https://w1.hoopchina.com.cn/images/pc/old/favicon.ico
// @grant        none
// @require      https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
// @require      https://gist.githubusercontent.com/SDUhuaxia/c267468f211d4a2cf921548d456aa959/raw/8cb18ee9c3f7183ec21c417c72ee1ac2cf9cc9d7/waitForKeyElements.js#md5=tft8SDGCQ2aUyQo5PlkbTg==
// ==/UserScript==

(function() {
    'use strict';
    /* globals jQuery, $, waitForKeyElements */
    waitForKeyElements(".thread-img", function(){
        var imgs = document.querySelectorAll(".thread-img")
        var x;
        for (x = 0; x < imgs.length; x++) {
            $(imgs[x]).css({"width": "auto","max-width": "30%","height": "auto"})
        }
    });
    waitForKeyElements(".thread-content-detail", function(jNode){
        // 使用querySelectorAll()函数选择该div内部的所有img标签
        let imgElements = jNode.find("img");
        var i;
        for (i = 0; i < imgElements.length; i++) {
            if(!$(imgElements[i]).hasClass("hupu-custom-emoji") && !$(imgElements[i]).hasClass("thread-img")){
                $(imgElements[i]).css({"width": "auto","max-width": "30%","height": "auto"});
            }
        }
    });
})();