Get to know MDN better
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.
The XRHitTestSource interface of the WebXR Device API handles hit test subscriptions. You can get an XRHitTestSource object by using the XRSession.requestHitTestSource() method.
This object doesn't itself contain hit test results, but it is used to compute hit tests for each XRFrame by calling XRFrame.getHitTestResults(), which returns XRHitTestResult objects.
None.
Unsubscribes from the hit test.
Call XRSession.requestHitTestSource() to get a hit test source.
To unsubscribe from a hit test source, call XRHitTestSource.cancel(). Since the object will no longer be usable, you can clean up and set the XRHitTestSource object to null.
| WebXR Hit Test Module # hit-test-source-interface |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 10, 2023 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.