您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Whenever the user scrolls using the mouse wheel it will disable all methods to programmatically scroll for 1000 ms. Basically preventing websites to implement custom scrolling behaviors like smooth scrolling.
当前为
// ==UserScript== // @name Don't fuck with my scroll!!! // @namespace http://github.com/YePpHa // @version 1.0 // @description Whenever the user scrolls using the mouse wheel it will disable all methods to programmatically scroll for 1000 ms. Basically preventing websites to implement custom scrolling behaviors like smooth scrolling. // @author Jeppe Rune Mortensen <[email protected]> // @match http://*/* // @match https://*/* // @grant none // @run-at document-start // ==/UserScript== (function() { 'use strict'; var inject = function() { var timeout = 1000; function init() { function enableScrolling() { window.scrollBy = _scrollBy; window.scrollTo = _scrollTo; Object.defineProperty(scrollingElement, "scrollTop", { configurable: true, enumerable: false, get: _scrollTopGetter, set: _scrollTopSetter }); } function disableScrolling() { window.scrollBy = _void; window.scrollTo = _void; Object.defineProperty(scrollingElement, "scrollTop", { configurable: true, enumerable: false, get: _scrollTopGetter, set: _void }); } function scrollHandler() { disableScrolling(); clearTimeout(timer); timer = setTimeout(enableScrolling, timeout); } var scrollingElement = document.scrollingElement; var _void = function() {}; var _scrollBy = window.scrollBy; var _scrollTo = window.scrollTo; var _scrollTopGetter = scrollingElement.__lookupGetter__("scrollTop"); var _scrollTopSetter = scrollingElement.__lookupSetter__("scrollTop"); var timer; scrollingElement.addEventListener("wheel", scrollHandler, { passive: false, capture: true }); window.addEventListener("wheel", scrollHandler, { passive: false, capture: true }); scrollingElement.addEventListener("mousewheel", scrollHandler, { passive: false, capture: true }); window.addEventListener("mousewheel", scrollHandler, { passive: false, capture: true }); } function isReady() { return document.readyState === "complete" || document.readyState === "interactive"; } function handleReadyStateChange() { if (isReady()) { document.removeEventListener("readystatechange", handleReadyStateChange, false); init(); } } if (isReady()) { init(); } else { document.addEventListener("readystatechange", handleReadyStateChange, false); } }; var script = document.createElement("script"); script.type = "text/javascript"; script.appendChild(document.createTextNode('(' + inject.toString() + ')();')); (document.body || document.head || document.documentElement).appendChild(script); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址