W3C home > Mailing lists > Public > public-webappsec@w3.org > January 2016

Permissions work - status and intent to update

From: Harald Alvestrand <harald@alvestrand.no>
Date: Wed, 27 Jan 2016 12:11:23 +0100
To: "public-media-capture@w3.org" <public-media-capture@w3.org>
Cc: mlamouri@google.com, "public-webappsec@w3.org" <public-webappsec@w3.org>
Message-ID: <56A8A5DB.8030802@alvestrand.no>

some time ago I made my proposal for MediaCapture permissions into a
pull request here:


I've had some dialogue with Mounir about it afterwards (partly in the
PR), and I intend to make the following updates:

- Delete the "all-*" variants of permissions
- Add a new meaning to the descriptor: If there's no device in it, it
means "any"
- Add a new value for the descriptor: If the device is "*", it means "all".

Thus, you could say

navigator.permissions.query({name:'camera'}).then(function(result)) {
  if (result.state == 'granted') {
      // I know I can request "any camera" and get something, if any
cameras exist

navigator.permissions.query({name:'camera', deviceId='*'}).then(
  if (result.state == 'granted') {
      // I know I have access to all cameras that exist

navigator.permissions.query({name:'camera', deviceId='abcdef'}).then(
  if (result.state == 'granted') {
     // I know I have access to the specific camera with id 'abcdef'

Does this make sense to people?
(I'm not 100% sold on the usefulness of the '*' device ID myself...)

Since this crosses two WGs, perhaps comments on the PR itself is easiest.

Received on Wednesday, 27 January 2016 11:11:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:54:54 UTC