Created
September 26, 2023 02:19
-
-
Save airtonix/e5485d588fd7b9cde286ebf38bb87906 to your computer and use it in GitHub Desktop.
Disable autoscroll 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 Scroll | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Disable mouse middle button completely. As a result it does not activate browser auto scroll. Open hyperlink in a new tab with middle button click still works. | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.addEventListener("mousedown", function(mouseEvent) { | |
if (mouseEvent.button != 1) { | |
return; | |
} | |
mouseEvent.preventDefault(); | |
mouseEvent.stopPropagation(); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment