- From: Raphael Kubo da Costa via GitHub <sysbot+gh@w3.org>
- Date: Fri, 29 Jul 2022 16:18:46 +0000
- To: public-device-apis-log@w3.org
> 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". `DeviceMotionEvent.requestPermission()` is quite different from a potential `AmbientLightSensor.requestPermission()` behind the scenes. Contrary to the Generic Sensors spec (and ALS), the Device Orientation spec did/does not integrate with the Permissions spec, so `requestPermission()` was added as a way of making it possible to require user consent without introducing a behavior change to what was already in the spec. The Generic Sensors API does integrate with the Permissions spec, and requesting permission is already part of [`Sensor.start()`](https://w3c.github.io/sensors/#sensor-start). `ALS.requestPermission()` would either be redundant or require changing the Generic Sensor behavior and adding the method to the base `Sensor` interface instead. > I feel like that approach at least has buy-in from WebKit and Chrome, with Mozilla's position tbc. Per https://webkit.org/tracking-prevention/ (particularly the "Anti Fingerprinting" section) I wouldn't worry too much about WebKit in this context. > 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. > > Btw, I see that [permissions.request()](https://github.com/WICG/permissions-request) and [permissions.revoke()](https://github.com/WICG/permissions-revoke) are now back in the WICG confounded Given WICG/permissions-request#5 and the level of activity in both WICG specs, I don't think these APIs will (re)appear any time soon and would not count on them. @engedy is an editor for both though, so he might have more information about this. -- GitHub Notification of comment by rakuco Please view or discuss this issue at https://github.com/w3c/ambient-light/issues/79#issuecomment-1199657752 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 29 July 2022 16:18:48 UTC