RoughScroll

Disables smooth scrolling on ALL websites

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         RoughScroll
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Disables smooth scrolling on ALL websites
// @author       Hayden Schiff (oxguy3)
// @match        *://*/*
// @grant        none
// ==/UserScript==
/* jshint -W097 */
'use strict';

/*
HEY YOU! PRO-TIP:
If you want to save some bandwidth by not downloading smooth scrolling scripts, 
add the following rules to the custom filters list on your favorite ad blocking
browser extension:
/jquery.nicescroll*.js
/jquery.smoothscroll*.js
/jquery.smooth-scroll*.js
/jquery-smoothscroll*.js
/jquery-smooth-scroll*.js
/nicescroll*.js
/smoothscroll*.js
/smooth-scroll*.js
/mousewheel-smooth-scroll
/surbma-smooth-scroll
/dexp-smoothscroll.js
*/

// a million thanks to Arnavion for showing me this trick
// source: http://stackoverflow.com/a/35611393/992504
document.getElementsByTagName("body")[0].addEventListener("wheel",function (event)
{
    // exception for ACE Editor, JS text editor used by sites like GitHub
    if (event.target.classList.contains('ace_content')) {
        return;
    }
    
    event.stopPropagation();
}, true);