javascript permissions api code example
Example: permission api js
navigator.permissions.query({name:'geolocation'}).then(function(result) {
if (result.state == 'granted') {
showLocalNewsWithGeolocation();
} else if (result.state == 'prompt') {
showButtonToEnableLocalNews();
}
// Don't do anything if the permission was denied.
});
//name: camera
//name: microphone