您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Proportionally enlarge smaller stand-alone images
当前为
// ==UserScript== // @name Upsize Stand-Alone Images // @author Jefferson "jscher2000" Scher // @namespace JeffersonScher // @version 0.5 // @copyright Copyright 2017 Jefferson Scher // @license BSD-3-Clause // @description Proportionally enlarge smaller stand-alone images // @match http*://*/* // @grant none // ==/UserScript== var tgt, resizeTimeout; function resizeImg(e){ var whratio = tgt.width / tgt.height; var wnew = window.innerWidth; var hnew = Math.round(wnew * (1 / whratio)); if (hnew > window.innerHeight){ hnew = window.innerHeight; wnew = Math.round(hnew * whratio); } tgt.width = wnew; tgt.height = hnew; } function resizeThrottler(){ if(!resizeTimeout){ resizeTimeout=setTimeout(function(){resizeTimeout=null;resizeImg();},200); } } if (document.querySelector('head').innerHTML.indexOf('TopLevelImageDocument.css') > -1) { tgt = document.querySelector('body img'); // first image in body if (tgt.className.indexOf('shrinkToFit') == -1) { // if Firefox is already managing resizing, do nothing console.log(tgt.) window.addEventListener('resize', resizeThrottler, false); window.setTimeout(resizeImg, 100); } }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址