It's like the new w3c permissions API but with suger on top
Today we have too many different permission request APIs. Geolocation, Desktop notification, Media devices and so on, but they are all inconsistent and broken in some ways. Some of them even lack useful informations such as "was the permission dissmissed, denied or granted?", "Do I already have access?" among other things. That's why the w3c has started to introduce a new model for permissions in browsers which is cool. But they don't cover all the stuff you can query/request permission for and it doesn't work in all browsers.
Browser SU tries to solves three main issues
- Querying and keeping track of permission
- Requesting with one simple syntax
- Added feature detecting
The Permission API is a living standard and keeps changing. They don't cover all the permissions. The request is not finalized yet. And you get more useful information with this then what you would get with the standard API.
I try to stay consistent as much as possible with the permissions API. But doing some neat trade-off.
https://jsfiddle.net/1awLpe59/12
// Querying
su.query({name: 'description', ...opts }).then(resolve, reject)
// Requesting
su.request({name: 'description', ...opts }).then(resolve, reject)
https://github.com/jimmywarting/browser-su/wiki/
npm install
npm run build