XRSystem: ondevicechange

Secure context

This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

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. 


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



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


Specification Status Comment
WebXR Device API
The definition of 'ondevicechange ' in that specification.
Working Draft Initial definition.

Browser compatibility

BCD tables only load in the browser

See also