navigator.permissions.query code example
Example: permission api query 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