From d38bece14b2b6d2b2608e449dbf3f44f9d1d57e9 Mon Sep 17 00:00:00 2001 From: crosswk Date: Wed, 29 Jul 2026 21:37:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=20auto-accept=20=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E6=94=B9=E7=94=B1=20PermissionRequested=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=99=A8=E6=8E=88=E6=9D=83=E9=BA=A6=E5=85=8B?= =?UTF-8?q?=E9=A3=8E=EF=BC=88=E4=BD=BF=E6=9D=83=E9=99=90=E6=8C=81=E4=B9=85?= =?UTF-8?q?granted=E4=BB=A5=E6=81=A2=E5=A4=8D=E8=AE=BE=E5=A4=87=E6=9E=9A?= =?UTF-8?q?=E4=B8=BE=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src-tauri/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/src-tauri/src/main.rs b/client/src-tauri/src/main.rs index ee1fa59..d43dc5c 100644 --- a/client/src-tauri/src/main.rs +++ b/client/src-tauri/src/main.rs @@ -23,8 +23,12 @@ use std::thread; /// com.sayit.app/EBWebView. Keep them global; never copy them into a single window's /// `additionalBrowserArgs` in tauri.conf.json (WebView2 rejects the second environment /// with ERROR_INVALID_STATE when the option sets differ). +// 注意:不要再加回 --auto-accept-camera-and-microphone-capture。 +// 该参数会抢先自动处理权限请求,使 PermissionRequested 事件不触发,权限停留在 "prompt", +// 导致新版 WebView2 隐藏 enumerateDevices 的设备名/deviceId。麦克风授权改由下面的 +// PermissionRequested 处理器负责(显式 Allow → 变为持久 granted → 恢复设备枚举)。 const WEBVIEW2_BROWSER_ARGS: &str = - "--ignore-certificate-errors --auto-accept-camera-and-microphone-capture \ + "--ignore-certificate-errors \ --disable-backgrounding-occluded-windows --disable-renderer-backgrounding \ --disable-background-timer-throttling";