navigator.getVRDisplays() asked the browser for connected VR headsets as VRDisplay objects. Learn the Promise result, how it differs from activeVRDisplays, why it is deprecated and non-standard, and how to move to WebXR with five examples and try-it labs.
01
Kind
Method
02
Returns
Promise<VRDisplay[]>
03
Status
Deprecated · Non-standard
04
API family
Old WebVR
05
Related
activeVRDisplays
06
Modern path
navigator.xr
Fundamentals
Introduction
Before WebXR, browsers experimented with WebVR. One entry point was navigator.getVRDisplays() — “which VR displays are available?”
That Promise resolved to an array of VRDisplay objects. From there, legacy apps could inspect display IDs and start presenting. Today you should not start new projects on WebVR.
⚠️
Available vs presenting
getVRDisplays() listed connected / known displays. activeVRDisplays listed only displays that were already presenting.
Concept
Understanding the getVRDisplays() Method
No parameters — call navigator.getVRDisplays().
Returns a Promise — resolves to an array of VRDisplay objects.
Empty array — no displays found (or VR idle / unsupported path).
Missing method — typical on modern browsers without WebVR.
Not for new apps — use WebXR (navigator.xr) instead.
Foundation
📝 Syntax
Legacy WebVR form:
JavaScript
navigator.getVRDisplays()
Parameters
None.
Return value
A Promise that fulfills with an array of VRDisplay objects.
Modern replacement sketch
JavaScript
if (navigator.xr) {
const ok = await navigator.xr.isSessionSupported("immersive-vr");
console.log("immersive-vr supported:", ok);
// Later: await navigator.xr.requestSession("immersive-vr");
} else {
console.log("WebXR not available — use a framework or 2D fallback");
}
Four facts to remember about navigator.getVRDisplays().
Returns
Promise
VRDisplay array
Status
Deprecated
+ Non-standard
Family
WebVR
Superseded
Prefer
navigator.xr
WebXR Device API
Compare
📋 WebVR vs WebXR Entry Points
WebVR (getVRDisplays)
WebXR (navigator.xr)
Status
Deprecated / Non-standard
Current immersive standard path
What you get
VRDisplay[] via Promise
XRSystem → sessions
Start experience
Legacy present APIs on VRDisplay
requestSession("immersive-vr")
New projects
Avoid
Prefer (or use a framework)
Hands-On
Examples Gallery
Examples feature-detect first. On most modern machines without WebVR you will see a missing method or an empty array — that is the expected beginner outcome.
📚 Getting Started
Detect the legacy method and query available displays.
Example 1 — Feature Detection
Check whether getVRDisplays exists before calling it.
{"ok":true,"reason":"webxr","immersiveVr":false,"tip":"Call requestSession after a user gesture when ready"}
(or no-navigator-xr / immersiveVr:true with a headset)
How It Works
This is the path new immersive apps should take — not getVRDisplays().
Applications
🚀 Common Use Cases
Legacy sample reading — understand old WebVR demos and blog posts.
navigator.getVRDisplays() is deprecated and non-standard. It belonged to the old WebVR API and is missing in most modern browsers. Prefer navigator.xr or a maintained XR framework, and always feature-detect before calling.
Google ChromeWebVR removed — use WebXR where available
Unavailable
Microsoft EdgePrefer WebXR (Chromium)
Unavailable
OperaPrefer WebXR where available
Unavailable
Mozilla FirefoxLegacy WebVR era ended — feature-detect
Unavailable
Apple SafariNo WebVR getVRDisplays path
Unavailable
Internet ExplorerNo WebVR / WebXR support
Unavailable
getVRDisplays()Removed / rare
Bottom line: Do not ship new WebVR code. Detect navigator.xr, use isSessionSupported / requestSession, or adopt A-Frame, Three.js, or Babylon.js.
Wrap Up
Conclusion
navigator.getVRDisplays() listed available VR headsets in the deprecated WebVR era. Learn it to read old samples, then build new immersive experiences with navigator.xr or a maintained framework.
Deprecated WebVR listing API — migrate immersive work to WebXR.
5
Core concepts
🧮01
Returns
Promise array
VRDisplay
⚠02
Status
Deprecated
+ Non-standard
🔌03
Lists
available displays
Not only presenting
✨04
Prefer
navigator.xr
WebXR
🛡05
Fallback
2D / frameworks
Always
❓ Frequently Asked Questions
It is a legacy WebVR method that returns a Promise resolving to an array of VRDisplay objects for VR headsets connected to the computer.
No. MDN marks it Deprecated and Non-standard. Prefer the WebXR Device API via navigator.xr, or a framework such as A-Frame, Three.js, or Babylon.js.
getVRDisplays() lists available VR displays (connected / known to the browser). activeVRDisplays lists only displays that are currently presenting (isPresenting === true).
The WebXR Device API. Start with navigator.xr, then isSessionSupported() and requestSession() for modes like immersive-vr.
Legacy WebVR APIs were typically restricted to secure contexts where they still existed. Feature-detect and assume HTTPS / localhost for any immersive work.
Usually the method is missing, or the Promise resolves to an empty array. That is expected without WebVR support and a headset.
Did you know?
WebVR and WebXR can sound similar, but they are different APIs. getVRDisplays() belongs to WebVR. New immersive VR work belongs on navigator.xr (WebXR) or a framework that wraps it.