Secure contextThis 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.
Syntax
navigator.xr.ondevicechange = function(event) { ... };
Value
Example
navigator.xr.ondevicechange = function(ev) {
console.log("The availability of immersive XR devices has changed.")
};
Specifications
Specification | Status | Comment |
---|---|---|
WebXR Device APIThe definition of 'ondevicechange ' in that specification. | Working Draft | Initial definition. |
Browser compatibility
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Chrome
Full support 79 |
Edge
Full support 79 |
Firefox
No support No |
IE
No support No |
Opera
No support No |
Safari
No support No |
WebView Android
No support No |
Chrome Android
Full support 79 |
Firefox Android
No support No |
Opera Android
No support No |
Safari iOS
No support No |
Samsung Internet Android
Full support 11.2 |
Legend
- Full support
- Full support
- No support
- No support
- Experimental. Expect behavior to change in the future.'
- Experimental. Expect behavior to change in the future.
See also
XRSystem: ondevicechange by Mozilla Contributors is licensed under CC-BY-SA 2.5.