W3cubDocs

/DOM

window.onvrdisplayconnect

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

The onvrdisplayconnect property of the Window interface represents an event handler that will run when a compatible VR display has been connected to the computer (when the vrdisplayconnect event fires).

The event object is of type VRDisplayEvent.

Syntax

window.onvrdisplayconnect = function() { ... };

Examples

window.onvrdisplayconnect = function() {
  info.textContent = 'Display connected.';
};

Specifications

Specification Status Comment
WebVR 1.1
The definition of 'onvrdisplayconnect' in that specification.
Draft Initial definition

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support No
Disabled
No
Disabled
Disabled This feature is behind the WebVR preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? 63
63
Only Windows and macOS support is enabled.
55
Only Windows support is enabled.
No No No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support ? Yes
Yes
Chrome for Android 56 supports only Google Daydream View.
Chrome for Android 57 adds support for Google Cardboard.
? 55 No No Yes
Yes
Supported on Samsung Internet for GearVR.

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/window/onvrdisplayconnect