Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web compat issue with permissions.query() in per-camera/mic permission models #927

Closed
jan-ivar opened this issue Feb 3, 2023 · 2 comments · Fixed by #932
Closed

Web compat issue with permissions.query() in per-camera/mic permission models #927

jan-ivar opened this issue Feb 3, 2023 · 2 comments · Fixed by #932

Comments

@jan-ivar
Copy link
Member

jan-ivar commented Feb 3, 2023

Permissions integration says: "If the descriptor does not have a deviceId, its semantic is that it queries for access to all devices of that class." — Since no-one's implemented deviceId, this is the norm for sites today:

const perm = await navigator.permissions.query({name: "camera"});
if (perm.state == "prompt") {
  nagTheUserAboutEnablingPermission();
}

But this site is trying to ask "can I call getUserMedia unprompted?", not "do I categorically have access to ALL cameras?"

Even after the site has a camera, Firefox cannot answer yes here, because it grants per-device permissions by default, not to ALL.

It would be more web compatible to say: "If the descriptor does not have a deviceId, its semantic is that it queries for access to the default device of that class."

Sites that truly wish to check the permission state of multiple cameras are able to do so.

@jan-ivar jan-ivar changed the title First web compat issue with permissions.query() in per-camera/mic permission models Web compat issue with permissions.query() in per-camera/mic permission models Feb 3, 2023
@jan-ivar
Copy link
Member Author

s/default device/any device/ based on offline feedback.

@dontcallmedom-bot
Copy link

This issue was discussed in WebRTC Feb 2023 Meeting – (Issue #927 🎞︎)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants