Created
July 19, 2017 16:02
-
-
Save jackm/45e523c8d544d2d8dd9d506ab5177a57 to your computer and use it in GitHub Desktop.
Disable auto scrolling userscript
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 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