-
Notifications
You must be signed in to change notification settings - Fork 21
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
Expose GeolocationSensor to dedicated workers #37
Comments
Spec-wise, this change seems like a minimal IDL update. Using the same identifier
And similarly in the Generic Sensor API:
@reillyeon did I overlook something? I'm thinking what needs to be specced in addition, if any, to ensure UAs can surface possible permission dialogs from within dedicated and shared workers. The integration points are https://w3c.github.io/sensors/#request-sensor-access and https://w3c.github.io/permissions/#request-permission-to-use Implementation-wise, how much plumbing there is to be done in Chromium to expose |
The current language does not make a distinction between requesting access to a sensor in a way that might prompt the user for permission vs. checking that the user has already granted permission or that permission is granted by default. When designing the worker support for WebUSB we settled on allowing a dedicated worker to exercise permissions that the parent frame already had but not to request additional permissions. I don't think the Putting on my Blink hat, there are implementation complexities which mean that we are more likely to expose sensors only to dedicated workers and not to shared workers. Chrome and Firefox are the only major browsers implementing shared workers and Chrome does not enable them on Android. |
It seems that |
Opened a separate issue for requesting permission: w3c/sensors#388 |
I submitted two PRs for the IDL update:
|
Looking back at my previous comment and @kenchris's link to the general discussion of In the main frame if you call |
I am a bit afraid that a |
|
Just thinking out loud here: could there be a Feature Policy that would allow a page to "pass" user gestures to workers/frames? If the page says in its hypothetical Feature Policy
…then the worker/frame could directly ask for permission itself.
I don't think that's very elegant, there should be something more lightweight, maybe like the admittedly completely vague proposal above. |
Updated the issue title to reflect consensus and spec updates that exposed to dedicated workers the following interfaces:
|
User activation transfer could provide a mechanism for requesting permissions from workers in the context of a user gesture in the frame.
I should have made it clear that was a strawman proposal. I think it's pretty inelegant as well. Transfering user activations into a worker seems like the right long-term solution but I'm not convinced that a |
🎉 This looks exactly like it's providing the functionality that I was envisioning, we don't even need a feature policy, as both the page and the iframe (or worker in the concrete case of this issue) need to agree on the message (but it might still be nice to have one). I have subscribed myself to whatwg/html#4369 to see how it ends. |
Reassess whether our identified use cases, in particular the foreground geotracking use cases, would benefit from
GeolocationSensor
exposed to dedicated and shared workers similarly toNavigatorNetworkInformation
and some other APIs. We know this feature can be polyfilled, but that comes with a performance hit (incl. battery) that might negatively impact some important use cases.We have a F2F resolution to do this but I wanted to resurface the resolution before we update the spec to loop in the wider community and gather new data from recent experiments that have been done meanwhile.
For example, @tomayac has recently experimented with Wake Lock API and geolocation, and as such has a fresh view on requirements for apps that might benefit from this feature.
The text was updated successfully, but these errors were encountered: