From c0fbe4a13f20b5dd3d04eb0154c9d74f7ec6b155 Mon Sep 17 00:00:00 2001 From: Sulthan Zaki Date: Tue, 28 Jul 2026 20:30:19 +0700 Subject: [PATCH] fix(userscript): suppress the long-press context menu on the edge tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- userscript/manga-bookmark.user.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/userscript/manga-bookmark.user.js b/userscript/manga-bookmark.user.js index 97aaaa9..ba21e96 100644 --- a/userscript/manga-bookmark.user.js +++ b/userscript/manga-bookmark.user.js @@ -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; }