Skip to content

Instantly share code, notes, and snippets.

@oxguy3
Last active September 27, 2023 15:02
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oxguy3/ebd9fe692518c7f7a1e9 to your computer and use it in GitHub Desktop.
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)
// ==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);
@jeggy
Copy link

jeggy commented Dec 11, 2017

For easy install, I published your script to greasyfork

@ivanovdenislav
Copy link

great job!

@felipebarreiros
Copy link

Awesome code!
For the record, do you have any examples of sites that it breaks?

@hamitozdemir
Copy link

Thank you for the custom filter list. It also works for browsing the site with space key unlike the script itself.

@mandrael
Copy link

mandrael commented Mar 10, 2020

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