Does WebXR work on cross origin iframe?

Hi guys,

As the question says, does WebXR work on cross origin iframe?

The problem is that the enter vr button only shows up when the iframe is not embedded, as soon as the iframe is embedded to another page, the enter vr button does not show at all.

If anyone knows how to make the webxr work on cross origin iframe please let me know.

Thank you,

Cc @RaananW

Need to check that! good question. WebXR does require user permissions, so that might be the case. Though if the button doesn’t show up it means that navigator.xr is probably not available. I’ll run a test or two and see what’s the state there.


let me know when you got something. :wink:

(The truely awesome) Ada Rose Cannon has an interesting article about it - Using WebXR in HTML IFrames. It’s possible but a few pitfalls to… | by Ada Rose Cannon | Samsung Internet Developers | Medium

Exactly what you need to check. https on parent and iframe, and xr-spatial-tracking permission in the iframe.


Works. Thanks :wink: