- From: Will Morgan via GitHub <sysbot+gh@w3.org>
- Date: Wed, 27 Jul 2022 13:59:49 +0000
- To: public-device-apis-log@w3.org
@reillyeon That does clarify, thanks. I do see the appeal of reusing the camera permission. On the other hand, I'd have thought that `navigator.permissions.request()` should be the API that solves this. As far as I can tell however, [sentiment towards it is negative](https://github.com/w3c/permissions/issues/83) and there's a preference towards explicit methods. It's also worth noting that requesting camera permission in this way still wouldn't scope that permission to a given device. As of today, Safari doesn't support the Permissions API at all; in Firefox while `.query()` is implemented, `.request()` is not. If developers want to build a rich, interactive experience on the web platform, queueing prompt after prompt isn't a great user experience. To request motion data and camera on Safari on iOS, you have two separate, blocking prompts that the user needs to click. To make matters worse, the decision to deny permission is cached until you reload the page, which can break SPAS. In my opinion, it's likely that developers are going to be requesting more than one permission for their experiences, so the `navigator.permissions.request()` API would make sense. However I appreciate the contention and good points in that area, and the motivation in why we're considering `camera` permissions instead. The permission/privacy/query/request landscape is already quite fragmented, and I'm not sure if shoehorning in ALS permissions through the camera is going to make things better, even if I really, really want to use it in production today(!) I can see parallels being drawn with accelerometer/magnetometer permissions, where `DeviceMotionEvent.requestPermission()` needs to be called to grant access in Safari, with Chrome to [follow suit](https://chromestatus.com/feature/5051845089689600) shortly (last checked 26th July 2022). Would a more consistent way of doing this be to keep the `ambient-light-sensor` permission name, and expose `AmbientLightSensor.requestPermission()`? The wording for the request could be something like "Origin X requests permission to access information about the lighting conditions in your environment". I feel like that approach at least has buy-in from WebKit and Chrome, with Mozilla's position tbc. -- GitHub Notification of comment by willmorgan Please view or discuss this issue at https://github.com/w3c/ambient-light/issues/79#issuecomment-1196800370 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 27 July 2022 13:59:51 UTC