Open evan-king opened 7 years ago
This greasemonkey script provides a passable workaround, as work on drag-scroll is unlikely to begin any time soon.
// ==UserScript==
// @name DragCompanion
// @namespace Honoredsoft
// @description Cover for Grab 'n Drag's failure to suppress context menu
// @version 1
// @grant none
// ==/UserScript==
const RCLICK = 2, MAX_DELTA = 9;
let x = 0, y = 0, delta = 0;
document.addEventListener('mousedown', function(event) {
if(event.button !== RCLICK) return;
x = event.screenX;
y = event.screenY;
}, false);
document.addEventListener('contextmenu', function(event) {
delta = Math.abs(x - event.screenX) + Math.abs(y - event.screenY);
if(delta > MAX_DELTA) event.preventDefault();
}, true);
Drag operations that end very near their start will still pop up the menu, but this happens so rarely in practice I deem it better not to add a mousemove listener to address it.
Occurring in Pale Moon Version: 27.4.1 (64-bit) on Windows 10. Appears to only occur on drag clicks that begin and end outside content areas (away from text/images) but not limited to any discernable high-level DOM scopes.