v147 · WebXR · demo

Capability Inspector

Check whether this browser and device support WebXR with plane detection — and explore the XRPlane object that the API surfaces for each detected surface.

navigator.xr — WebXR Device API checking…

The WebXR Device API is the foundation for all WebXR features. Without it, plane detection is unavailable.

const supported = "xr" in navigator;
immersive-ar session type checking…

Plane detection is only available inside an immersive-ar session — the mode where the device's camera feed is composited with virtual content.

await navigator.xr.isSessionSupported("immersive-ar");
plane-detection optional feature checking…

When requesting an AR session, opt in to plane detection with the optionalFeatures array. The browser will only include plane data if the device hardware and OS support it.

await navigator.xr.requestSession("immersive-ar", { optionalFeatures: ["plane-detection"] });
XRFrame.detectedPlanes checking…

Each animation frame provides an XRPlaneSet — an iterable of all planes detected so far. Planes persist across frames and update as the tracking system refines their geometry.

// Inside requestAnimationFrame callback: session.requestAnimationFrame((time, frame) => { const planes = frame.detectedPlanes; // XRPlaneSet for (const plane of planes) { drawPlane(plane, frame, refSpace); } });

Live capability probe

navigator.xr.isSessionSupported() + XRFrame.detectedPlanes
Run the probe to call the live WebXR APIs when this browser exposes them.
XRPlane object — properties
orientation
"horizontal" | "vertical"
Semantic label. "horizontal" for floors, tables, shelves. "vertical" for walls and doors.
polygon
FrozenArray<DOMPointReadOnly>
Ordered list of 3D points (in the plane's local coordinate system) forming the boundary polygon of the detected surface.
planeSpace
XRSpace
Coordinate space for the plane. Use XRFrame.getPose(plane.planeSpace, refSpace) to get the plane's transform in world space.
lastChangedTime
DOMHighResTimeStamp
Timestamp of the most recent update to this plane's geometry. Lets you skip reprocessing planes that haven't changed this frame.

see also