Re: [w3c/permissions] A more modest request() (#158)

Thanks @garykac 
I'm not suggesting this for the clipboard API (I think that would be disruptive). Rather, I'm suggesting that we rethink how we design such APIs in the future. But if we were to apply this to the clipboard API, the idea would be like you suggest: removing navigator.clipboard and returning a handle to the capability in a promise. I disagree that this undermines the model discussed in #83. In fact, I would argue that it better adheres to the philosophy described in #83. Namely, if you merely have a clipboard.request() function that returns no promise, it conceptually separates user consent from usage (which was the problem described). If you have a request() function that returns a promise to a handle, you're in a situation where requesting permission and resource acquisition are tied together as suggested in #83:
> I believe that coupling of request and consequence to be important.

Actually I think it's helpful to get away from the word "request". It has too much baggage associated with it now. Adding a generic request() function is not intended to separate consent and acquisition. It would be intended intended to standardize API design for APIs that require getting a handle to some system-level capability that may require user consent. This is a pattern that we're seeing come up more and more and solutions tend to be ad hoc.

-- 
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/158#issuecomment-333730479

Received on Tuesday, 3 October 2017 03:44:11 UTC