XRSystem: ondevicechange

The ondevicechange property of the XRSystem interface is passed a devicechange event whenever availability of an immersive device changes. The event that is fired is a "simple event" that implements the Event interface.

Syntax

navigator.xr.ondevicechange = function(event) { ... };

Value

undefined

Example

navigator.xr.ondevicechange = function(ev) {
  console.log("The availability of immersive XR devices has changed.")
};

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
ondevicechange
79
79
No
No
No
No
No
79
No
No
No
11.2

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRSystem/ondevicechange