A Tour of the JavaScript Permissions API

1 · · Jan. 5, 2020, midnight
If you have ever created a web application which requires different features (like push notifications, webcam access, midi access), you probably noticed that their APIs look very different. // for the geolocation API you need to call getCurrentPosition to check if geolocation is accessible navigator.geolocation.getCurrentPosition(gotLocation, didNotGetLocation); // for notifications we can directly check on the Notification object if (Notification.permission == 'granted') // do notification ...