This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The Permissions interface of the Permissions API provides the core Permission API functionality, such as methods for querying and revoking permissions
Methods
Permissions.query()- Returns the user permission status for a given API.
Permissions.request()- Requests permission to use a given API. This is not currently supported in any browser.
Permissions.revoke()- Revokes the permission currently set on a given API.
Example
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.
});
Specification
| Specification | Status | Comment |
|---|---|---|
| Permissions The definition of 'Permissions' in that specification. |
Working Draft | Initial definition. |
Browser Support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Permissions | Chrome Full support 43 | Edge ? | Firefox Full support 46 | IE ? | Opera ? | Safari ? | WebView Android Full support 43 | Chrome Android Full support 43 | Edge Mobile ? | Firefox Android Full support 46 | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
query | Chrome Full support 43 | Edge ? | Firefox Full support 46 | IE ? | Opera ? | Safari ? | WebView Android Full support 43 | Chrome Android Full support 43 | Edge Mobile ? | Firefox Android Full support 46 | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
request | Chrome Full support 46 | Edge ? | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android Full support 46 | Chrome Android Full support 46 | Edge Mobile ? | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
requestAll | Chrome Full support 48 | Edge ? | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android Full support 48 | Chrome Android Full support 48 | Edge Mobile ? | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
revoke | Chrome Full support 46 | Edge ? | Firefox
Full support
51
| IE ? | Opera ? | Safari ? | WebView Android Full support 46 | Chrome Android Full support 46 | Edge Mobile ? | Firefox Android
Full support
51
| Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
accelerometer permisson | Chrome Full support 62 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 62 | Chrome Android Full support 62 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
accessibility events permisson | Chrome Full support 62 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 62 | Chrome Android Full support 62 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
ambient-light-sensor permisson | Chrome Full support 62 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 62 | Chrome Android Full support 62 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
accelerometer permisson | Chrome Full support 62 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 62 | Chrome Android Full support 62 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
camera permission | Chrome Full support 64 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 64 | Chrome Android Full support 64 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
clipboard-read permisson | Chrome Full support 64 | Edge ? | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android Full support 64 | Chrome Android Full support 64 | Edge Mobile ? | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
clipboard-write permission | Chrome Full support 64 | Edge ? | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android Full support 64 | Chrome Android Full support 64 | Edge Mobile ? | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
geolocation permission | Chrome Full support 43 | Edge ? | Firefox ? | IE ? | Opera Full support 30 | Safari ? | WebView Android No support No | Chrome Android Full support 43 | Edge Mobile ? | Firefox Android ? | Opera Android Full support 30 | Safari iOS ? | Samsung Internet Android ? |
background-sync permission | Chrome Full support 51 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 51 | Chrome Android Full support 51 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
magnetometer permission | Chrome Full support 62 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 62 | Chrome Android Full support 62 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
microphone permission | Chrome Full support 64 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 64 | Chrome Android Full support 64 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
midi permission | Chrome Full support 43 | Edge ? | Firefox ? | IE ? | Opera Full support 30 | Safari ? | WebView Android No support No | Chrome Android Full support 43 | Edge Mobile ? | Firefox Android ? | Opera Android Full support 30 | Safari iOS ? | Samsung Internet Android ? |
notifications permission | Chrome Full support 43 | Edge ? | Firefox ? | IE ? | Opera Full support 30 | Safari ? | WebView Android No support No | Chrome Android Full support 43 | Edge Mobile ? | Firefox Android ? | Opera Android Full support 30 | Safari iOS ? | Samsung Internet Android ? |
payment-handler permission | Chrome Full support 66 | Edge ? | Firefox ? | IE ? | Opera ? | Safari ? | WebView Android Full support 66 | Chrome Android Full support 66 | Edge Mobile ? | Firefox Android ? | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
persistent-storage permission | Chrome No support No | Edge ? | Firefox Full support 53 | IE ? | Opera No support No | Safari ? | WebView Android No support No | Chrome Android No support No | Edge Mobile ? | Firefox Android Full support 53 | Opera Android No support No | Safari iOS ? | Samsung Internet Android ? |
push permission | Chrome Full support 43 | Edge ? | Firefox ? | IE ? | Opera Full support 30 | Safari ? | WebView Android No support No | Chrome Android Full support 43 | Edge Mobile ? | Firefox Android ? | Opera Android Full support 30 | Safari iOS ? | Samsung Internet Android ? |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- User must explicitly enable this feature.
- User must explicitly enable this feature.
Document Tags and Contributors
Tags:
Contributors to this page:
mdnwebdocs-bot,
sideshowbarker,
fscholz,
chrisdavidmills,
Sheppy,
ebidel,
poiru,
jpmedley
Last updated by:
mdnwebdocs-bot,