fix: macOS webcam permission request and camera access not working#1
Conversation
- setPermissionCheckHandler/RequestHandler에 "camera" 권한 추가 - entitlements.mac.plist, inherit.plist에 camera/microphone/audio-input entitlement 추가 - electron-builder.json5에 NSCameraUsageDescription 추가 및 잘못된 extendInfo 키 제거 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThese changes grant the macOS application runtime access to camera and microphone devices by adding corresponding entitlements to the app's plist configuration files, updating the build configuration with a camera usage description, and extending Electron's permission handler to allow camera access requests. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
"camera"tosetPermissionCheckHandler/setPermissionRequestHandler— without this, Electron silently blocks allgetUserMedia({ video: true })calls from the renderercom.apple.security.device.camera,microphone, andaudio-inputentitlements to bothentitlements.mac.plistandentitlements.mac.inherit.plist— required for Hardened Runtime signed buildsNSCameraUsageDescriptiontoextendInfoinelectron-builder.json5and remove the misplacedcom.apple.security.device.audio-inputkey from thereRoot Cause
Signed builds with Hardened Runtime enforce entitlements strictly — any permission not declared is silently denied by macOS. In
devmode the app runs unsigned, so entitlements are never checked and the webcam worked fine. In production builds, the missing camera entitlement caused macOS to block the permission request entirely, so the app never appeared in System Settings › Privacy & Security › Camera.Test plan
npm run build:mac)tccutil reset Camera com.newturn2017.screencraft🤖 Generated with Claude Code
Summary by CodeRabbit