The WebXR Device API (a W3C Candidate Recommendation Draft) gives a page a headset's pose, controllers and hands, and renders one view per eye. Chromium 4,389 browsers have shipped it since Chrome 79 1 , Meta Quest Browser included, and Safari 10 supports it on visionOS 2 and later, but not on the Mac or iPhone; Firefox 555 lacks it.
With no headset here, every run below uses IWER (iwer 2.5.0, MIT), Meta's JavaScript WebXR runtime that emulates a Quest 3 and powers the Immersive Web Emulator 465 extension Babylon 89,603 recommends. The frames are real Babylon.js renders; the headset is emulated:
var quest = new IWER.XRDevice(IWER.metaQuest3);
quest.installRuntime({ forceInstall: true }); // replace Chrome's own navigator.xr
{
const space = IWER.XRReferenceSpace.prototype; // 2.5.0 drops the offset that Babylon
const offset = space.getOffsetReferenceSpace; // passes to place or teleport the camera
space.getOffsetReferenceSpace = function (origin) {
return offset.call(this, origin.matrix);
};
}The patch fixes a bug found here: IWER read the XRRigidTransform given to getOffsetReferenceSpace as a matrix, so the camera snapped back a frame after each teleport.