Cannot use Permissions API to get status of camera
Reported by
joe.pal...@iproov.com,
Sep 20 2016
|
|||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Steps to reproduce the problem:
Run the following command in the console:
navigator.permissions.query({name: 'camera'})
What is the expected behavior?
A promise with camera permission status as defined here:
https://w3c.github.io/permissions/#dom-permissionname-camera
What went wrong?
Failed to read the 'query' property from 'Permissions': The provided value 'camera' is not a valid enum value of type PermissionName.
Did this work before? No
Chrome version: 52.0.2743.116 Channel: n/a
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0
,
Sep 21 2016
,
Sep 21 2016
hta: could you help find the right person to add this API?
,
Mar 13 2017
Is there anyway I can help get this issue looked at?
,
Apr 5 2017
,
Apr 19 2017
Thanks for assigning an owner. Let me know if there is anything I can do to help.
,
Apr 19 2017
+1. If I can help then let me know.
,
Jun 27 2017
I would be great if we can get some progress on this. At the moment, the only way check if we have permission is by turning the camera on and off again which is not a great user experience.
,
Jun 27 2017
#8: use navigator.mediaDevices.enumerateDevices and check if the device has a track label. If it has you have permission.
,
Jun 27 2017
Nice one, thanks for the tip! :)
,
Jun 27 2017
Note that you can't use that to discern the difference between a dismissal or a denial of the prompt -- the lack of a label will still mean either "prompt" or "denied". Still would be really beneficial to use the much more powerful Permission API for this.
,
Jun 27 2017
Totally agree, the Permission API would be the best way of doing this. But we should be able to use the presence of label to determine if permission was granted in a previous session without having to request access (and turning on the camera).
,
Jul 5 2017
Able to reproduce this issue on Windows 10, Ubuntu 14.04 and Mac 10.12.5 with chrome Stable #59.0.3071.115, Canary #61.0.3149.0 and also in earlier version #45.0.2454.101, hence marking it as untriaged. Attaching a screen-cast for reference.
,
Aug 4 2017
,
Nov 14 2017
I have a WIP CL for this now.
,
Nov 14 2017
+rbyers - I'm not sure if this will require an intent to ship. The intent to ship for the permissions API did not list these permissions (https://groups.google.com/a/chromium.org/forum/#!search/intent$20to$20ship$20permissions$20api/blink-dev/exHjHQzY6m0/tIkqg_W2fjIJ), but we're not really changing the web-exposed surface here. Perhaps a web-facing PSA and mention in the blog post will be sufficient? WDYT?
,
Nov 14 2017
It is technically a new API (we need to update MDN) but I agree it's trivial. If you just want to reply to the original intent thread to update it (saying I didn't think a new intent was necessary), that's fine with me. Just make sure MDN gets updated (yourself and/or by jmedley).
,
Nov 15 2017
c#17: thanks! I'll reply to the original intent thread to update it when I land the patch. +jmedley for visibility - when my patch lands, we'll want to update MDN to say that "camera" and "microphone" are available in navigator.permissions.query().
,
Nov 15 2017
Original intent to ship is updated: https://groups.google.com/a/chromium.org/forum/#!search/permissions$20api$20intent$20to$20ship/blink-dev/exHjHQzY6m0/tIkqg_W2fjIJ
,
Nov 15 2017
,
Nov 16 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/04f4a2b429d099ecfe0fb80de34797b4fd52fddf commit 04f4a2b429d099ecfe0fb80de34797b4fd52fddf Author: Dominick Ng <dominickn@chromium.org> Date: Thu Nov 16 01:26:32 2017 Allow the Permissions API to get the status of the camera and microphone. This CL adds camera and microphone to the permissions that can be queried using navigator.permissions.query(). BUG= 648553 Change-Id: I238ce81401862918c4a01b331142c59756862f5e Reviewed-on: https://chromium-review.googlesource.com/765619 Reviewed-by: Raymes Khoury <raymes@chromium.org> Reviewed-by: Mounir Lamouri <mlamouri@chromium.org> Commit-Queue: Dominick Ng <dominickn@chromium.org> Cr-Commit-Position: refs/heads/master@{#516940} [modify] https://crrev.com/04f4a2b429d099ecfe0fb80de34797b4fd52fddf/third_party/WebKit/LayoutTests/http/tests/permissions/resources/test-query.js [modify] https://crrev.com/04f4a2b429d099ecfe0fb80de34797b4fd52fddf/third_party/WebKit/Source/modules/permissions/PermissionDescriptor.idl [modify] https://crrev.com/04f4a2b429d099ecfe0fb80de34797b4fd52fddf/third_party/WebKit/Source/modules/permissions/Permissions.cpp
,
Nov 16 2017
I've now updated the MDN docs (https://developer.mozilla.org/en-US/docs/Web/API/Permissions/query) mentioning Chrome 64 as supporting these. :) |
|||||||||||
►
Sign in to add a comment |
|||||||||||
Comment 1 by dtapu...@chromium.org
, Sep 20 2016