Skip to content

Commit

Permalink
Ignore clicks on native scrollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
joeytwiddle committed Mar 13, 2022
1 parent 1c195f7 commit 0c27a05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Scroll_Everywhere/scrolle.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// @include *
// @grant GM_addStyle
// @run-at document-body
// @version 0.3l
// @version 0.3m
// ==/UserScript==

/* jshint multistr: true, strict: false, browser: true, devel: true */
Expand Down Expand Up @@ -69,6 +69,12 @@ if (window.top === window.self) {
}

function handleMouseDown(e) {
// From: https://stackoverflow.com/questions/10045423/determine-whether-user-clicking-scrollbar-or-content-onclick-for-native-scroll
var wasClickOnScrollbar = e.offsetX > e.target.clientWidth || e.offsetY > e.target.clientHeight;
if (wasClickOnScrollbar) {
//console.log('Ignoring click on scrollbar:', e);
return;
}
if (e.which == mouseBtn) {
if (startAfterLongPress) {
startLongPress(e);
Expand Down

0 comments on commit 0c27a05

Please sign in to comment.