JavaScript Navigator activeVRDisplays Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

navigator.activeVRDisplays is a read-only property from the old WebVR API. It returns an array of every VRDisplay that is currently presenting (VRDisplay.isPresenting is true) ((MDN).

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use navigator.activeVRDisplays. Start with this line.

JavaScript
navigator.activeVRDisplays
CallWhat it does
navigator.activeVRDisplaysPrimary signature.

Built into the browser. Read navigator.activeVRDisplays on Navigator — no import required.

Library declarations
JavaScript
navigator.activeVRDisplays

Parameters

ParameterDescription
Feature detectRequired. Property is often missing

Return Value

Return ValueDescription
*The current value of navigator.activeVRDisplays.

JavaScript Examples

Example 1 — Feature-Detect Support

Check whether the property exists before reading it.

JavaScript
if ("activeVRDisplays" in navigator) {
  console.log("available (legacy WebVR)");
} else {
  console.log("missing — prefer navigator.xr");
}
Try It Yourself

How It Works

  1. Use in. Checks whether the property exists on navigator.
  2. Legacy path. If present, you are in an old WebVR-capable environment.
  3. Common path. Most browsers today omit it entirely.
  4. Next step. Point learners toward navigator.xr for new work.

Example 2 — List Active Displays (MDN)

MDN pattern: loop presenting displays and log each displayId.

JavaScript
function showActive() {
  if (!("activeVRDisplays" in navigator)) {
    console.log("unsupported");
    return;
  }
  const displays = navigator.activeVRDisplays;
  for (const display of displays) {
    console.log(`Display ${display.displayId} is active.`);
  }
  if (displays.length === 0) {
    console.log("none presenting");
  }
}

showActive();
Try It Yourself

How It Works

  1. Guard first. Avoid reading a missing property.
  2. Read the array. Only presenting displays are included.
  3. Loop. Log each displayId like the MDN sample.
  4. Empty array. Supported engine, but nothing presenting right now.

Example 3 — Prefer navigator.xr

Migration tip: detect WebXR instead of depending on WebVR.

JavaScript
if ("xr" in navigator && navigator.xr) {
  console.log("WebXR available — use navigator.xr");
} else if ("activeVRDisplays" in navigator) {
  console.log("legacy WebVR only — do not start new apps here");
} else {
  console.log("no WebXR / WebVR entry point");
}
Try It Yourself

How It Works

  1. Check WebXR first. navigator.xr is the modern entry point.
  2. Legacy branch. Only mention WebVR if you are reading old code.
  3. Neither. Provide a 2D fallback UI.
  4. Rule. New immersive apps should not call activeVRDisplays.

Browser Support

navigator.activeVRDisplays is marked Deprecated and Non-standard on MDN. It belonged to the old WebVR API, which was superseded by WebXR and is largely removed from modern browsers.

✓ Deprecated · Non-standard

Navigator.activeVRDisplays

Legacy WebVR array of presenting VRDisplay objects. Expect missing support in current Chrome, Safari, Firefox, and Edge — feature-detect and prefer navigator.xr.

Legacy WebVR era
Google Chrome WebVR removed / unavailable
No support
Mozilla Firefox WebVR removed / unavailable
No support
Apple Safari Not available
No support
Microsoft Edge WebVR removed / unavailable
No support
Opera Not available
No support
Internet Explorer Not available
No support
activeVRDisplays Deprecated

Bottom line: Do not ship new features on this property. Migrate to navigator.xr (WebXR) or a framework such as A-Frame, Three.js, or Babylon.js.

Frequently Asked Questions

It is a read-only Navigator property from the old WebVR API. It returns an array of VRDisplay objects that are currently presenting (VRDisplay.isPresenting is true).
No. MDN marks it Deprecated and Non-standard. Prefer the WebXR Device API via navigator.xr for new VR/AR work, or a framework like A-Frame, Three.js, or Babylon.js.
Either no VR display is presenting right now, or the property exists but nothing is in an immersive presenting state. On most modern browsers without WebVR, the property may be missing entirely.
Yes in supporting browsers: MDN lists it as a secure-context feature (HTTPS or localhost).
The WebXR Device API. Start with navigator.xr, then isSessionSupported() and requestSession() for immersive-vr or other modes.
No. It is read-only. You inspect presenting displays; you do not assign to the property.

Next: appCodeName

Continue with the next Navigator property in the JavaScript guide.

appCodeName tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful