navigator.xr
.requestSession("immersive-ar", {
requiredFeatures: ["local", "hit-test"],
optionalFeatures: ["anchors"],
})
.then((xrSession) => {
// Log enabledFeatures
console.log(xrSession.enabledFeatures);
// Check if anchors can be used
if (xrSession.enabledFeatures.includes("anchors")) {
// Go ahead and set up anchors
}
});XRSession: enabledFeatures property / notebook
XRSession: enabledFeatures property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.