- changed component to Framework
Device permissions query incorrectly returns denied state
When CEF is started with --enable-media-stream
flag, media devices such as camera and microphone are accessible whenever requested by applications. This in fact means that permissions have been granted by users.
Expected
CEF’s Permissions API when called using navigator.permissions.query
returns state: "granted"
for both camera and microphone
Actual
However, CEF’s Permissions API returns denied
permission state for both camera and microphone
navigator.permissions.query({name:"microphone"}) // PermissionState: { name: "audio_capture", onchange: null, state: "denied"}
In contrast with CEF, Chrome’s permissions API returns state: "granted'
when camera/microphone is accessible.
How to Reproduce
- start CEF with
--enable-media-stream
-
Visit either of WebRTC example pages for audio / video to verify that camera/microphone is accessible
-
Open devtools and execute
navigator.permissions.query({name:"microphone"})
Versions used:
97.1.1+g50067f2+chromium-97.0.4692.71 / Chromium 97.0.4692.71 - Sample client, Windows 64 bit.
NOTE about use-fake-ui-for-media-stream
Despite the close relation with permissions, chromium’s use-fake-ui-for-media-stream
flag does not seem to have any effect on the permissions state in either CEF or chromium navigator.permissions.query({name:"microphone"})
:
- CEF:
// PermissionState: { name: "audio_capture", onchange: null, state: "denied"}
- Chromium:
// PermissionState: { name: "audio_capture", onchange: null, state: "prompt"}
Comments (5)
-
-
The
navigator.permissions.query
call is implemented by Permissions::query in the renderer process calling PermissionServiceImpl::HasPermission in the browser process. That then calls PermissionControllerImpl::GetPermissionStatusForFrame which returns DENIED becauseAlloyBrowserContext::GetPermissionControllerDelegate
is not implemented in CEF (returns nullptr). -
Implementation of
PermissionControllerDelegate
is blocked on issue #2582. -
- changed status to duplicate
Duplicate of #2582.
-
reporter Thanks for the fast responses and the additional context!
- Log in to comment