Device permissions query incorrectly returns denied state

Issue #3241 duplicate
Karlis Venters created an issue

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

  1. start CEF with --enable-media-stream
  2. Visit either of WebRTC example pages for audio / video to verify that camera/microphone is accessible

    1. https://webrtc.github.io/samples/src/content/getusermedia/audio/
    2. https://webrtc.github.io/samples/src/content/getusermedia/gum/
  3. 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)

  1. Log in to comment