feat(desktop): auto-grant getUserMedia on Linux + Windows #127
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lc-129-getusermedia-permission-hooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Closes LC-129. Wires media-stream permission handlers into the underlying webview so WebRTC voice / video calls work without per-platform user intervention. Covers LC-129's Linux + Windows scope; Apple + mobile slices live in LC-134 / LC-135 / LC-136 under the LC-133 deferred tracker.
Behaviour
Linux (WebKit2GTK) silently denies
getUserMediaunless the host handles thepermission-requestsignal; without this PR the camera / mic prompt never reaches the OS and a call attempt fails silently. Now the WebKit2GTK webview'sconnect_permission_requesthandler downcastsUserMediaPermissionRequestand callsrequest.allow(), so the OS-level prompt surfaces once and the granted permission is remembered across launches via WebKit2GTK's normal per-origin cache.Windows (WebView2) cancels
PermissionRequestedby default. The new handler wires off the controller returned by wry'sPlatformWebview::controller()and sets state toCOREWEBVIEW2_PERMISSION_STATE_ALLOWforCAMERAandMICROPHONE. WebView2 persists the allow decision in its user data folder.Unconditional grant is acceptable here: the webview never navigates off
LETS_CHAT_SERVER_URL(config.rs + theset_server_urlIPC command enforce this), and a compromised configured server can already exfiltrate everything via the IPC bridge, so denying inside the binary would not add a meaningful capability boundary.Dependency notes
webview2-com = "0.38"andwindows = "0.61"are pinned to align with the transitive versions wry pulls in. An earlier attempt withwebview2-com = "0.33"blew up with the two-versionwebview2-com-syscargo error (theParam<ICoreWebView2PermissionRequestedEventHandler>trait bound resolves against the wrong version).webkit2gtk = "2"matches the libwebkit2gtk-4.1 ABI that wry links against.Test plan
./dev/cargo-desktop check -p lets-chat-desktop(Linux compile, dev profile)just build-desktop-windows(cross-compile tox86_64-pc-windows-gnu, release profile)just check(workspace fmt + clippy across standalone and saas)