fix(userscript): suppress the long-press context menu on the edge tab

touch-action: none stops panning and zooming but not Chromium's
long-press gesture. It fires at ~500ms, just after ARM_MS, raises the
context menu and cancels the pointer stream — so the hold armed the drag
and the OS stole it back a frame later, leaving the page's own long-press
UI on screen and the tab where it was.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-28 20:30:19 +07:00
parent 8633ee9804
commit c0fbe4a13f
+7 -1
View File
@@ -1048,6 +1048,12 @@
reset();
if (didDrag) snapToEdge(); // OS claimed the gesture mid-drag — don't strand the FAB
});
// touch-action: none stops panning and zooming but NOT Chromium's long-press
// gesture, which fires at ~500ms — just after ARM_MS — raises the context
// menu, and cancels the pointer stream. The hold armed the drag and the OS
// stole it back a frame later. Suppressing the menu keeps the pointer alive.
fab.addEventListener("contextmenu", (e) => e.preventDefault());
}
// ============================================================
@@ -1403,7 +1409,7 @@
border-radius: 4px 0 0 4px;
background: #6d28d9; opacity: .45;
box-shadow: 0 2px 8px rgba(0,0,0,.4); z-index: 2147483646; cursor: pointer;
touch-action: none; user-select: none;
touch-action: none; user-select: none; -webkit-touch-callout: none;
}
#fab.left { border-radius: 0 4px 4px 0; }
#fab:active, #fab.armed { opacity: 1; }