On Tue, 25 Aug 2015, at 07:57, Anne van Kesteren wrote:
> On Sat, Aug 22, 2015 at 5:03 AM, Birunthan Mohanathas
> <birunt...@mohanathas.com> wrote:
> > Summary: The Permissions API allows a web application to be aware of
> > the status of a given permission, to know whether it is granted,
> > denied or if the user will be asked whether the permission should be
> > granted.
> 
> I'm not a big fan of this API.
> 
> 1) It doesn't map well to what browsers do internally. Rather than
> simple strings it uses some kind of convoluted dictionary design.

Browsers internal implementation can change. The API will have to stay
as it is in the long run. It's better to have an flexible API that would
allow different implementation strategies.

> 2) It would be better to simply expose the permission status of a
> particular feature near a particular feature. If you want to know
> whether geolocation is already granted you should just be able to call
> navigator.geolocation.permission() or some such.

This isn't working for some APIs. For example, MIDI has a very basic
navigator.requestMIDIAccess(). Should we start having
navigator.queryMidiAccess()?

> 3) It seems the API is evolving in ways to also request permission
> without then directly using that permission. It's not clear that is a
> good idea.

This is something that is already doable. If a webpage calls
navigator.geolocation.getCurrentPosition(), it doesn't need to do
anything with the position (this can apply to roughly any API). The
Notififcations API has an explicit call for requesting too. Furthermore,
allowing requests will open some new possibilities like requesting a
'paste' permission which can't be done today.

-- Mounir
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to