Disable auto scrolling userscript
This file contains 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 Disable auto scrolling | |
// @version 1.0 | |
// @description Disables auto scrolling on pages (ie. middle mouse scrolling) | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
var target; | |
window.addEventListener('mousedown', function(mouseEvent) { | |
if(mouseEvent.button != 1) | |
return; | |
target = mouseEvent.target; | |
mouseEvent.preventDefault(); | |
mouseEvent.stopPropegation(); | |
}, true); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment