This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The onchange event handler of the PermissionStatus interface is called whenever the PermissionStatus.state property changes.


PermissionStatus.onchange = function() { ... }
PermissionStatus.addEventListener('change', function() { ... })


navigator.permissions.query({name:'geolocation'}).then(function(permissionStatus) {
  console.log('geolocation permission state is ', permissionStatus.state);
  permissionStatus.onchange = function() {
    console.log('geolocation permission state has changed to ', this.state);


Specification Status Comment
The definition of 'onchange' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Chrome Full support 43Edge ? Firefox Full support 46IE ? Opera ? Safari ? WebView Android No support NoChrome Android Full support 43Edge Mobile ? Firefox Android Full support 46Opera Android ? Safari iOS ? Samsung Internet Android ?


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.

Document Tags and Contributors

Last updated by: mfluehr,