您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove the height/overflow limits of readmore-container and set the height of readmore-init to 100%.
// ==UserScript== // @name anti techgrow // @version 1.0.1 // @description Remove the height/overflow limits of readmore-container and set the height of readmore-init to 100%. // @author zhumeme // @match *://*/* // @run-at document-end // @grant none // @namespace https://github.com/zhumeme/anti-techgrow // ==/UserScript== (function () { 'use strict'; console.log('[readmore-fix] userscript loaded', location.href); /* 1. Create a style with the highest specificity */ const style = document.createElement('style'); style.textContent = ` #readmore-container{ height:auto !important; max-height:none !important; overflow:visible !important; }`; document.head.appendChild(style); /* 2. Fix the height setting in readmore-init */ function patchInitScript(node) { if (node.id === 'readmore-init') { node.textContent = node.textContent .replace(/height\s*:\s*['"]?\d+['"]?/, 'height:"100%"'); const s = document.createElement('script'); s.textContent = node.textContent; node.after(s); // Re-execute node.remove(); // Remove the original script console.log('[readmore-fix] init-script patched'); } } /* 3. Patch already existing scripts once */ [...document.scripts].forEach(patchInitScript); /* 4. Observe SPA route changes or asynchronous insertions */ const ob = new MutationObserver(muts => { muts.forEach(m => m.addedNodes.forEach(n => patchInitScript(n))); }); ob.observe(document.documentElement, { childList: true, subtree: true }); })();