Re: [permissions] Add permissions.request() (#41)

Also, it's unclear what you were considering, but I think rejecting is *not* good for denied permission. It's not exceptional, and causes lots of ergonomic issues when used with `async`/`await`. Here's my main point of comparison:

```js
// always-fulfilled:

if ((await navigator.permissions.request({ name: 'geolocation' }).state === "granted") {
  useGeolocation();
} else {
  tellUserWeAreSadAboutTheirChoice();
}

// rejection on denied:

let ok = false;
try {
  await navigator.permissions.request({ name: 'geolocation' });
  ok = true;
} catch (e) {
  tellUserWeAreSadAboutTheirChoice();
}

if (ok) {
  useGeolocation();
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/permissions/issues/41#issuecomment-121666242

Received on Wednesday, 15 July 2015 16:17:47 UTC