feat(desktop): add macOS screen-capture entitlement for getDisplayMedia (LC-137) #455

Merged
nrupard merged 2 commits from feat/LC-137-macos-screen-share-entitlement into main 2026-06-26 14:51:26 +02:00
Member

WKWebView gained getDisplayMedia in macOS 13. The WebKit-layer consent is auto-granted by wry's WryWebViewUIDelegate (same path as getUserMedia), so there is no Rust-side permission hook to install. Under Tauri's default hardened runtime a signed app still cannot reach display capture without the com.apple.security.device.screen-capture entitlement, so add a desktop/lets-chat.entitlements file carrying that key and reference it from tauri.conf.json bundle.macOS.entitlements. macOS then raises the Screen Recording (TCC) prompt automatically on first display-capture request and remembers it across launches (no Info.plist usage string controls that prompt).

The entitlement is inert until the codesign step on the macOS build path lands (LC-126, parked for lack of macOS hardware + Apple credentials), mirroring the declarative-provisioning approach used for the camera/microphone slice. LC-134 adds the camera and audio-input entitlements to the same file; if both land independently the keys should be unioned.

#LC-137

WKWebView gained getDisplayMedia in macOS 13. The WebKit-layer consent is auto-granted by wry's WryWebViewUIDelegate (same path as getUserMedia), so there is no Rust-side permission hook to install. Under Tauri's default hardened runtime a signed app still cannot reach display capture without the com.apple.security.device.screen-capture entitlement, so add a desktop/lets-chat.entitlements file carrying that key and reference it from tauri.conf.json bundle.macOS.entitlements. macOS then raises the Screen Recording (TCC) prompt automatically on first display-capture request and remembers it across launches (no Info.plist usage string controls that prompt). The entitlement is inert until the codesign step on the macOS build path lands (LC-126, parked for lack of macOS hardware + Apple credentials), mirroring the declarative-provisioning approach used for the camera/microphone slice. LC-134 adds the camera and audio-input entitlements to the same file; if both land independently the keys should be unioned. #LC-137
feat(desktop): add macOS screen-capture entitlement for getDisplayMedia (LC-137)
Some checks failed
check-secrets / Kingfisher (push) Failing after 5s
check-secrets / Kingfisher (pull_request) Failing after 5s
check-secrets / TruffleHog (pull_request) Successful in 4s
check-secrets / Nosey parker (pull_request) Successful in 3s
check-secrets / TruffleHog (push) Successful in 3m29s
check-secrets / Nosey parker (push) Successful in 3m29s
Check / clippy + fmt + tests (pull_request) Successful in 3m46s
f868301b55
WKWebView gained getDisplayMedia in macOS 13. The WebKit-layer consent is auto-granted by wry's WryWebViewUIDelegate (same path as getUserMedia), so there is no Rust-side permission hook to install. Under Tauri's default hardened runtime a signed app still cannot reach display capture without the com.apple.security.device.screen-capture entitlement, so add a desktop/lets-chat.entitlements file carrying that key and reference it from tauri.conf.json bundle.macOS.entitlements. macOS then raises the Screen Recording (TCC) prompt automatically on first display-capture request and remembers it across launches (no Info.plist usage string controls that prompt).

The entitlement is inert until the codesign step on the macOS build path lands (LC-126, parked for lack of macOS hardware + Apple credentials), mirroring the declarative-provisioning approach used for the camera/microphone slice. LC-134 adds the camera and audio-input entitlements to the same file; if both land independently the keys should be unioned.

#LC-137
fix(desktop): drop fictional screen-capture entitlement (LC-137)
Some checks failed
check-secrets / Nosey parker (push) Successful in 3s
check-secrets / Nosey parker (pull_request) Successful in 4s
check-secrets / TruffleHog (push) Successful in 5s
check-secrets / TruffleHog (pull_request) Successful in 6s
check-secrets / Kingfisher (pull_request) Failing after 6s
check-secrets / Kingfisher (push) Failing after 14s
Check / clippy + fmt + tests (pull_request) Successful in 2m57s
Create release / Create release from merged PR (pull_request) Has been skipped
73a2cd613b
The previous commit added a com.apple.security.device.screen-capture key, but no such hardened-runtime entitlement exists. Screen recording on macOS is gated purely by TCC (the user-granted Screen Recording permission in System Settings), raised at runtime on the first display-capture request; no codesign entitlement and no Info.plist usage string controls it. The invented key was inert at best and risks tripping notarization once LC-126 wires signing. Apple's hardened-runtime entitlement list confirms there is no screen-capture key: https://developer.apple.com/documentation/security/hardened-runtime

So the screen-share slice adds nothing to the entitlements dict. Keep the file (now an empty dict) and its tauri.conf.json bundle.macOS.entitlements wiring as the landing spot LC-134 actually populates (camera + audio-input, which are real entitlements) and LC-126 extends with signing keys. Rewrite the file comment to state the TCC-only reality, and soften the wry getDisplayMedia claim: getUserMedia consent is auto-granted by wry's UI delegate, but whether WKWebView exposes getDisplayMedia and whether that delegate covers it is unverified and must be confirmed during the LC-126 macOS bring-up.

#LC-137

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
nrupard deleted branch feat/LC-137-macos-screen-share-entitlement 2026-06-26 14:51:26 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!455
No description provided.