您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the tp-modal-open class from <body> on load and DOM changes
// ==UserScript== // @name Remove tp-modal-open on Technology Review // @description Removes the tp-modal-open class from <body> on load and DOM changes // @match https://www.technologyreview.com/* // @version 0.0.1.20250404080811 // @namespace https://greasyfork.org/users/1435046 // ==/UserScript== (function() { 'use strict'; const removeOverflowFromClass = () => { for (const sheet of document.styleSheets) { let rules; try { rules = sheet.cssRules; } catch (e) { continue; // avoid CORS-restricted stylesheets } if (!rules) continue; for (const rule of rules) { if ( rule.selectorText === 'body.tp-modal-open' || rule.selectorText === '.tp-modal-open' || rule.selectorText === 'body.tp-modal-open, .tp-modal-open' ) { if (rule.style && rule.style.overflow) { rule.style.removeProperty('overflow'); } } } } }; // Run after DOM is ready if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', removeOverflowFromClass); } else { removeOverflowFromClass(); } // Re-run when styles might be added dynamically const observer = new MutationObserver(removeOverflowFromClass); observer.observe(document.documentElement, { childList: true, subtree: true }); })();