feat(desktop): wire macOS WKWebView getUserMedia permission hook (LC-134) #453
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-134-macos-getusermedia-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?
Adds the macOS slice of the cross-platform getUserMedia permission work (sibling of the existing Linux WebKit2GTK and Windows WebView2 handlers).
The WebKit-layer consent is already auto-granted on macOS: wry's WryWebViewUIDelegate implements requestMediaCapturePermissionForOrigin and calls the decision handler with WKPermissionDecision::Grant, so installing our own WKUIDelegate would only clobber wry's (file-upload panels, new-window handling). The macOS arm of install_media_permission_handler is therefore an explicit, documented no-op rather than the previous silent catch-all.
The actual macOS-specific requirement is the OS-level (TCC) prompt. WKWebView reaches the camera/mic through AVFoundation in the host app process, which macOS silently denies (or terminates the app) unless the bundle declares usage strings. desktop/Info.plist adds NSCameraUsageDescription and NSMicrophoneUsageDescription (auto-merged by tauri-bundler), and desktop/lets-chat.entitlements adds com.apple.security.device.camera / audio-input for the default hardened runtime, wired via bundle.macOS.entitlements. Together these yield exactly one OS prompt on the first call, remembered across launches.
These artifacts only take effect once the macOS build/sign/notarize path lands under LC-126 (currently parked); on Linux/Windows builds they are ignored and the new macOS cfg arm is compiled out, so just check / just test-desktop stay green.
#LC-134
Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com