Re: [w3c/permissions] Drop .request() (#83)

Let me belatedly summarize the pros and cons I see for `permissions.request()`, and the pros and cons I'm skeptical of so far:

**Pro**

1. Provides a new spelling for several old APIs where we can get their interfaces right.
1. Provides a uniform spelling for requesting a permission so developers don't have to learn the intricacies of each capability's request function. (This is tempered by each capability getting to refine its PermissionDescriptor, probably in non-uniform ways.) 

**Con**

1. Redundant with other, more tuned spellings of particular APIs. For example, [`getUserMedia()`](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-mediadevices-getusermedia) might have a way to express interacting constraints on the camera and microphone, which we wouldn't be able to express in the generic `request()` interface.
1. Might cause extra permission prompts. In Firefox's model, even if you request and get permission for something like geolocation, you probably can't call `getCurrentPosition()` without another prompt. If folks call `request()` thinking it'll get them access to use location wherever, they'll wind up spamming the user.

**Unconvincing Pro**

1. "`request()` is like Promises in that it'll help devs build libraries to treat a bunch of different permission requests uniformly." I think each capability is different enough that it'll be hard to do things like make arrays of `PermissionDescriptor`s, and because we want devs to ask for permissions in context, that wouldn't even necessarily be a good thing.

**Unconvincing Con**

1. "`request()` makes developers more likely to ask for permissions on startup." If devs find that prompting on startup gets them "the best conversion rate", they can do that with the existing functions. Just call `watchLocation()` on startup to get the prompt early, and then save the stream of values so you never have to ask again. We even have an extra lever with `request()` to inhibit asking on startup: it'll be web-compatible to [require a user gesture for a call to `request()`](https://github.com/w3c/permissions/issues/77), but it's less so to require it for `watchLocation()`.


Did I catch everything?

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/permissions/issues/83#issuecomment-215247344

Received on Wednesday, 27 April 2016 22:13:21 UTC