meta-quest / immersive-web-emulator

Browser extension that emulates Meta Quest devices for WebXR development. Lead: Felix Zhang (fe1ix@meta.com)
https://developer.oculus.com/blog/webxr-development-immersive-web-emulator/
MIT License
297 stars 34 forks source link

Ability to turn WebXR shim off without uninstalling the extension #14

Closed hybridherbst closed 1 year ago

hybridherbst commented 1 year ago

Maybe I'm missing something, but seems that currently when the extension is installed it always polyfills - since we also want to test codepaths where XR is not available that's not very helpful, so I had to remove the extension again.

Could maybe be as simple as having "None" in the device dropdown?

This also extends to a note written in the docs:

Even if native WebXR API is available the extension overrides it with WebXR polyfill

which is also not really ideal... I find the extension useful but constantly uninstalling / installing it while testing something is a bit.

felixtrz commented 1 year ago

I think it's a good idea, though I think it's not as straight forward to implement as it sounds.. A content script is automatically injected before the page loads, adding WebXR polyfill, and the page requires the script to communicate with the emulator UI. I will add this to my to-do list and will take a look as soon as I get some extra time.

felixtrz commented 1 year ago

What we do when we need to test codepaths where XR is not available is to open the WebXR app in incognito mode, extensions are turned off for incognito mode by default (can be changed by settings), and XR will not be available as a result.

hybridherbst commented 1 year ago

Thanks for the feedback. I understand the point about before-page-load injection. I think it would be totally fine if the page would reload when the "on/off" button is toggled (or if this change would only take effect on reload).

The incognito workaround is a bit problematic since it also turns off other extensions, auth information, etc., which are also good to have for development.

felixtrz commented 1 year ago

@hybridherbst Working on this now, this feature will be shipped in v1.3 (end of May release), but will be available sooner if you install from source as soon as I check it in (guessing by next week)

felixtrz commented 1 year ago

This feature was shipped in v1.3.0, closing issue