-
Notifications
You must be signed in to change notification settings - Fork 55
Not working on Chrome 87 in iframe + blob(?) #265
Comments
I think I found out what the possible cause is. I am testing with a local server with Chrome's "Allow invalid certificates for resources loaded from localhost." flag enabled, which results in an insecure connection... and WebXR requires a secure connection? |
Native WebXR API requires secure context to run but currently the WebXR Emulator extension should run even on insecure context. (I may change it in the future.) I'm not sure if I'm facing the same problem you faced, but I realized that on Chrome 88 the Three.js WebXR examples doesn't run on local dev server while they run on their online servers... (I haven't tested the other WebXR apps yet.) On both the local dev server and their online servers, the following console error appears when I attempt to enter an immersive mode.
On their online server I enter an immersive mode after the console error while I couldn't on the local dev server... I will investigate the problem but I guess it's a browser side problem? They seem to run on Firefox without any problems so using Firefox may be an easy workaround so far. |
i think this is related to this Problem mrdoob/three.js#20754 |
I'm not using three.js and I am calling navigator.xr.isSessionSupported( 'immersive-vr').then( supported => { directly without await. In both 88 and 87, supported returns false for Oculus Quest. Tested with an online secure server just now, and I got supported=false still. |
Upon further investigation, the problem is iframe. It needs special privilege to run VR and XR. This thread can now be closed. My suggestion, the same origin policy should enable VR and XR for an iframe by default. |
https://threejs.org/examples/#webxr_vr_ballshooter Would you share an online page where I can reproduce the problem? |
If you look into their iframe's attribute in developer console, it says
Looks like it is using WebVR, not WebXR, otherwise it should include this attribute:
|
Let me clarify what you reported. |
Let me make you a test case. Will update you a link for testing. |
Go here: https://www.otakhi.com/petridish?load=15723 Once the page loads, click the play button at bottom right corner.
The outcome is displayed in the green square. The HTTP response header of that page contains
And the inner iframe has the attributes allowvr="yes". You can change the script it executes by altering the script in the script popup. |
The root issue seems that Web extensions are not loaded in iframe in that example. I guess the extensions can be loaded in static iframe like Three.js examples but they can't be loaded in iframe dynamically added like your example. Did your example show |
It shows true in Firefox. WebVR works with WebVR Emulator in dynamic iframe. Only WebXR having issues. Never tried XR before. Want to see where it is at. |
I confirmed it shows true in Firefox. I noticed that the content in that example is blob. I guess Chrome stops to load the extension for blob because of security reason? I thought the current configurations of |
Perhaps it is a temporary design decision. Once the standard settles, Google will add another feature policy or simply enables it. I will contact Chromium team to figure out. |
From https://bugs.chromium.org/ discussion:
more info at this link, https://immersiveweb.dev/chrome-support.html Does this mean anything for WebXR device emulator ? |
I suspect the latest Chrome is loading OpenXR runtime directly from manufacturer's DLLs. And it must support sandboxing interfaces in those DLLs. If that's true, they'd bypass any javascript shim code and render any emulator ineffective? Just a thought. Let me correct myself, WebXR is at the very top layer. The emulator should be able to intersect all WebXR Calls to the hardware. ... except sandboxing. So the question is. Does Chrome allow extension to return TRUE about sandboxing support? A likely scenario is that Chrome bypasses emulator and query hardware driver to see it supports sandboxing, if not, it doesn't even bother loading the extension. Just a guess. |
I did find a working example online. So the culprit is likely the blob url in an iframe. I've posted a bug report to https://bugs.chromium.org/. Let's hear what they say. Further research seems to indicate that the developers' consensus is that the iFrame's SRC must use "HTTPS" for WebXR to work in Chrome. Firefox is clearly less restrictive in this respect. |
After migrating my app to use direct url instead of blob, I can confirm that it is indeed the culprit. This thread can now be closed. Thank you for your time. |
Hi, thanks for the investigation.
Could I have the URL to your ticket? |
Thanks! |
isSessionSupported('immerisve-vr') always returns false for latest release 0.3.1. SketchFab suggests installing Steam and SteamVR. Why is that necessary with WebXR emulator? Anyone encountered the same issue? The state of XR is really in a mess right now. Keeping WebVR and watching on the sideline still...
The text was updated successfully, but these errors were encountered: