Permissions

The Permissions API provides the uniform way for web applications to query for the permission status for the features that require user consent, like notifications or geolocation. With Permissions API the app can list the permissions granted by the user without actually trying to use the feature.

API glimpse

navigator.permissions.query({name: feature})
Returns a Promise resolved with the object representing the permission status of the requested feature.
permissionStatus.state
Returns the permission status of the requested feature, either granted, denied or - in case the user was not yet asked - prompt.
permissionStatus.addEventListener('change', listener)
An event fired when the permission status of the requested feature has changed.

Resources