This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
A WebXR Device API XRFrame object is passed into the requestAnimationFrame() callback function and provides access to the information needed in order to render a single frame of animation for an XRSession describing a VR or AR scene. Events which communicate the tracking state of objects also provide an XRFrame reference as part of their structure.
In addition to providing a reference to the XRSession for which this frame is to be rendered, the getViewerPose() method is provided to obtain the XRViewerPose describing the viewer's position and orientation in space, and getPose() can be used to create an XRPose describing the relative position of one XRSpace relative to another.
session Read only Experimental
The XRSession that for which this XRFrame describes the tracking details for all objects. The information about a specific object can be obtained by calling one of the methods on the object.
trackedAnchors Read only Experimental
An XRAnchorSet containing all anchors still tracked in the frame.
createAnchor() Experimental
Returns a Promise which resolves to a free-floating XRAnchor object.
fillJointRadii() Experimental
Populates a Float32Array with radii for a list of hand joint spaces. Returns true if successful for all spaces.
fillPoses() Experimental
Populates a Float32Array with the matrices of the poses, relative to a given base space. Returns true if all spaces have a valid pose.
getDepthInformation() Experimental
Returns an XRCPUDepthInformation object containing CPU depth information for the frame.
getHitTestResults() Experimental
Returns an array of XRHitTestResult objects containing hit test results for a given XRHitTestSource.
getHitTestResultsForTransientInput() Experimental
Returns an array of XRTransientInputHitTestResult objects containing hit test results for a given XRTransientInputHitTestSource.
getJointPose() Experimental
Returns an XRJointPose object providing the pose of a hand joint (see XRHand) relative to a given base space.
getLightEstimate() Experimental
Returns an XRLightEstimate object containing estimated lighting values for an XRLightProbe.
getPose() Experimental
Returns an XRPose object representing the spatial relationship between the two specified XRSpace objects.
getViewerPose() Experimental
Returns an XRViewerPose describing the viewer's position and orientation in a given XRReferenceSpace.
| Specification |
|---|
| WebXR Device API> # xrframe-interface> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
XRFrame |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 11.2 | No | No |
createAnchor |
85 | 85 | No | 71 | No | 85 | No | 60 | No | 14.0 | No | No |
fillJointRadii |
131 | 93–111Hololens 2 only. |
No | 116 | No | 131 | No | 87 | No | No | No | No |
fillPoses |
131 | 93–111Hololens 2 only. |
No | 116 | No | 131 | No | 87 | No | No | No | No |
getDepthInformation |
90 | 90 | No | 76 | No | 90 | No | 64 | No | 15.0 | No | No |
getHitTestResults |
81 | 81 | No | 68 | No | 81 | No | 58 | No | 13.0 | No | No |
getHitTestResultsForTransientInput |
81 | 81 | No | 68 | No | 81 | No | 58 | No | 13.0 | No | No |
getJointPose |
131 | 93–111Hololens 2 only. |
No | 116 | No | 131 | No | 87 | No | No | No | No |
getLightEstimate |
90 | 90 | No | 76 | No | 90 | No | 64 | No | 15.0 | No | No |
getPose |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 11.2 | No | No |
getViewerPose |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 11.2 | No | No |
session |
79 | 79 | No | 66 | No | 79 | No | 57 | No | 11.2 | No | No |
trackedAnchors |
85 | 85 | No | 71 | No | 85 | No | 60 | No | 14.0 | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRFrame