This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The Permissions API provides a consistent programmatic way to query the status of API permissions attributed to the current context — for example whether permission to use the API is granted or denied, and whether the user will be asked whether permission should be granted for an API.
Concepts and usage
Historically different APIs handle their own permissions inconsistently — for example the Notifications API allows for explicit checking of permission status and requesting permission, whereas the Geolocation API doesn't (which causes problems if the user denied the initial permission request). The Permissions API provides the tools to allow developers to implement a better user experience as far as permissions are concerned.
The permissions
property has been made available on the Navigator
object, both in the standard browsing context and the worker context (WorkerNavigator
— so permission checks are available inside workers), and returns a Permissions
object that provides access to the Permissions API functionality.
Once you have this object you can then perform permission-related tasks, for example querying a permission using the Permissions.query()
method to return a promise that resolves with the PermissionStatus
for a specific API.
Not all APIs' permission statuses can be queried using the Permissions API. Notable APIs that are Permissions-aware include:
-
Web MIDI API
More APIs will gain Permissions API support over time.
Examples
We have made a simple example available called Location Finder. You can run the example live, or view the source code on Github.
Read more about how it works in our article Using the Permissions API.
Interfaces
Navigator.permissions
andWorkerNavigator.permissions
Read only- Provides access to the
Permissions
object from the main context and worker context respectively. Permissions
- Provides the core Permission API functionality, such as methods for querying and revoking permissions.
PermissionStatus
- Provides access to the current status of a permission, and an event handler to respond to changes in permission status.
Specification
Specification | Status | Comment |
---|---|---|
Permissions | Working Draft | Initial definition. |
Browser compatibility
Permissions
interface
Desktop | Mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Basic support | Chrome Full support 43 | Edge ? | Firefox Full support 46 | IE ? | Opera ? | Safari ? | WebView Android No support No | 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 No support No | 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.