From 885be2fe851bdee2828da83ee948e0ffbc013b0c Mon Sep 17 00:00:00 2001 From: AskaEth Date: Mon, 17 Aug 2026 21:55:37 +0800 Subject: [PATCH] feat: disable webview long-press menu on launcher pages except inputs --- app/src/main/assets/h5/css/app.css | 13 +++++++++++++ app/src/main/assets/h5/index.html | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/app/src/main/assets/h5/css/app.css b/app/src/main/assets/h5/css/app.css index facf780..7a01d2d 100644 --- a/app/src/main/assets/h5/css/app.css +++ b/app/src/main/assets/h5/css/app.css @@ -8,6 +8,19 @@ /* 移除 WebView 默认蓝色点击高亮,改用下方 :active 的 Miuix 风格反馈 */ /* Remove the default blue tap highlight; use the Miuix-style :active feedback below */ -webkit-tap-highlight-color: transparent; + /* 禁用文本选择,避免长按弹出 WebView 选择/复制菜单(输入框除外) */ + /* Disable text selection to avoid the long-press WebView context menu (except inputs) */ + -webkit-user-select: none; + user-select: none; + -webkit-touch-callout: none; +} + +/* 输入框/文本域/可编辑区保留文本选择,长按可复制粘贴 */ +/* Inputs / textareas / editable areas keep text selection for copy/paste */ +input, textarea, [contenteditable="true"] { + -webkit-user-select: text; + user-select: text; + -webkit-touch-callout: default; } html, body { height: 100%; } diff --git a/app/src/main/assets/h5/index.html b/app/src/main/assets/h5/index.html index c9b09a7..2033f7f 100644 --- a/app/src/main/assets/h5/index.html +++ b/app/src/main/assets/h5/index.html @@ -8,6 +8,18 @@ +