RoughScroll

Disables smooth scrolling on ALL websites

目前为 2017-12-11 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name RoughScroll
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Disables smooth scrolling on ALL websites
  6. // @author Hayden Schiff (oxguy3)
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10. /* jshint -W097 */
  11. 'use strict';
  12.  
  13. /*
  14. HEY YOU! PRO-TIP:
  15. If you want to save some bandwidth by not downloading smooth scrolling scripts,
  16. add the following rules to the custom filters list on your favorite ad blocking
  17. browser extension:
  18. /jquery.nicescroll*.js
  19. /jquery.smoothscroll*.js
  20. /jquery.smooth-scroll*.js
  21. /jquery-smoothscroll*.js
  22. /jquery-smooth-scroll*.js
  23. /nicescroll*.js
  24. /smoothscroll*.js
  25. /smooth-scroll*.js
  26. /mousewheel-smooth-scroll
  27. /surbma-smooth-scroll
  28. /dexp-smoothscroll.js
  29. */
  30.  
  31. // a million thanks to Arnavion for showing me this trick
  32. // source: http://stackoverflow.com/a/35611393/992504
  33. document.getElementsByTagName("body")[0].addEventListener("wheel",function (event)
  34. {
  35. // exception for ACE Editor, JS text editor used by sites like GitHub
  36. if (event.target.classList.contains('ace_content')) {
  37. return;
  38. }
  39. event.stopPropagation();
  40. }, true);
  41.