fix: add setDevicePermissionHandler for Windows 11 webcam access

Chromium (Electron 17+) requires setDevicePermissionHandler in addition
to setPermissionCheckHandler/setPermissionRequestHandler. Without it,
device-level access is silently denied on Windows 11 even though the
permission check passes, causing getUserMedia to throw NotAllowedError.
This commit is contained in:
webadderall
2026-03-30 15:41:01 +11:00
parent 9b5e612b96
commit e8aa5ac5ad
+2
View File
@@ -627,6 +627,8 @@ app.whenReady().then(async () => {
callback(allowed.includes(permission));
});
session.defaultSession.setDevicePermissionHandler((_details) => true);
if (process.platform === "darwin") {
const cameraStatus = systemPreferences.getMediaAccessStatus("camera");
if (cameraStatus !== "granted") {