Why is there no webxr enter button icon on chrome?

On ordinary computer browser

For pages created using createDefaultVRExperience, the webvr entry button icon will appear on chrome.
Why does the webxr entry button icon not appear on chrome for pages created using createDefaultXRExperienceAsync?

webvr demo: https://playground.babylonjs.com/#ABDDD6#57

webxr demo: https://playground.babylonjs.com/#ABDDD6#76

Chrome version: 114.0.5735.134

看控制台, 你的浏览器不支持immersive-vr模式.
不过你可以通过 Immersive Web Emulator - Microsoft Edge Addons 这个扩展在浏览器模拟webxr的vr模式

Looking at the console, your browser does not support immersive-vr mode. But you can use Immersive Web Emulator - Microsoft Edge Addons This extension emulates webxr’s vr mode in your browser

image

I want ordinary browsers to turn on webxr, like webvr
polyfill?

Thai pants spicy!

What is the usecase of such behavior? if your browser doesn’t support WebXR, why force WebXR on it?

Yes, there is polyfill

const xrPolyfillPromise = new Promise((resolve) => {
    if (navigator.xr) {
        return resolve();
    }
    if (window.WebXRPolyfill) {
        new WebXRPolyfill();
        return resolve();
    } else {
        const url = "https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.js";
        const s = document.createElement("script");
        s.src = url;
        document.head.appendChild(s);
        s.onload = () => {
            new WebXRPolyfill();
            resolve();
        };
    }
});
1 Like

I didn’t say there isn’t a polyfill :slight_smile:

I asked what is the point of making a browser that doesn’t support WebXR have WebXR content?

The polyfill was thought as a wrapper to support the transition between WebVR and WebXR, back when mobile devices didn’t have WebXR support. there is no true need for the polyfill today.
Different emulators are adding their own polyfills to support emulating webxr in the browser (for test reasons). But still - a desktop browser that doesn’t support WebXR will continue not supporting WebXR, even if you add the polyfill.

1 Like

This requirement has no substantive significance.

In some places, VR devices are not widely available. I want to use this setting to inform my customers that my product has VR functionality. If you want to truly experience the VR effect, you need to purchase some of the VR devices I have listed. It’s a guide.

However, it can also be guided by other designs.

In that case just add the button and make it do nothing. Won’t that be a viable option?

2 Likes

You’re right, polyfill probably doesn’t make sense for desktop browsers.

I’m not questioning you. I just saw that he mentioned polyfill, so I gave the documentation of polyfill.

Yes, this is indeed an effective method

thank you very much