Last active
September 27, 2023 15:02
-
-
Save oxguy3/ebd9fe692518c7f7a1e9 to your computer and use it in GitHub Desktop.
Greasemonkey script for disabling smooth scrolling across the web (WIP! currently breaks a few websites, unfortunately)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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); | |
great job!
Awesome code!
For the record, do you have any examples of sites that it breaks?
Thank you for the custom filter list. It also works for browsing the site with space key unlike the script itself.
How to install? I don't find it @ greasyfork.
OK, I copied it into the User Script section. It works and the annoying smooth scrolling is history. Especially on MacBooks it's nothing else than a obstacle. Good it's gone now :-)
Anyway, you should publish.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For easy install, I published your script to greasyfork