This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2022.
The permissions read-only property of the Navigator interface returns a Permissions object that can be used to query and update permission status of APIs covered by the Permissions API.
A Permissions object.
navigator.permissions.query({ name: "geolocation" }).then((result) => {
if (result.state === "granted") {
showMap();
} else if (result.state === "prompt") {
showButtonToEnableMap();
}
// Don't do anything if the permission was denied.
});
| Specification |
|---|
| Permissions> # dom-navigator-permissions> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
permissions |
43 | 79 | 46 | 30 | 16 | 43 | 46 | 30 | 16 | 4.0 | No | 16 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/permissions