XR.ondevicechange

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

The XR.ondevicechange property of the XR 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

XR.ondevicechange = function(event) { ... };

Value

undefined

Example

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

Specifications

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

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
ondevicechange
ExperimentalNon-standard
Chrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

No support  
No support
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.

See also

Document Tags and Contributors

Contributors to this page: jpmedley, bershanskiy
Last updated by: jpmedley,