immersive-web / webxr-test-api

WPT testing API for WebXR
https://immersive-web.github.io/webxr-test-api/
14 stars 15 forks source link

Can we expose WebXR Testing API to Browser extension? #48

Open takahirox opened 4 years ago

takahirox commented 4 years ago

Hi all.

Background

We have been making WebXR Emulator browser extension which enables users to test WebXR applications on their desktop browser without the need of physical XR device by emulating the devices.

To emulate the devices, we use webxr-polyfill and override the native WebXR API even if the browser supports WebXR API because there seems no way to emulate XR device with the native WebXR API from JavaScript layer.

I've been looking for a way to emulate without overriding the native WebXR API and I found WebXR Testing API can be used to emulate(simulate).

Problem for us

I found this section https://immersive-web.github.io/webxr-test-api/#conformance in the spec

  1. Conformance Interfaces and functionality exposed by this specification SHOULD NOT be exposed to typical browsing experiences, and instead SHOULD only be used when running Web Platform Tests.

WebXR Testing API doesn't seem to be exposed to JavaScript in user code or the extension code.

Question

Can we expose WebXR Testing API to the browser extension? For example, we may add "webxrTest" key to permissions in manifest.json of WebExtensions API which allows the extension to access WebXR Testing API.

"permissions": [
  "webxrTest"
]

Here might not be the right place to discuss it. If so and you know the right place, I'm happy if you let me know.

Manishearth commented 4 years ago

That's not a "typical browsing experience", so sure :)

I think you need to convince individual browsers to do this, though.

Manishearth commented 4 years ago

I'm not sure how webextension API standardization works, or if they're standardized at all. We could standardized a permission if we really want to but we should have buy in from implementors.

takahirox commented 4 years ago

Thanks for the comment.

I know some WebExtensions APIs are standardized across browser vendors but I couldn't find WebExtensions API standardization group.

But I found "WebExtensions/NewAPIs" page for Firefox on Mozilla wiki and it seems I can propose a new WebExtensions API via bugzilla for them.

I couldn't find similar one for Chrome but I guess I can propose via their forum.

So, I guess I need to talk to them individually first.

Do you think it's worth to keep this issue opened if exposing to browser extension can somehow affect WebXR Testing API spec? Or should we close because it's out of WebXR Testing API spec itself?

alcooper91 commented 4 years ago

Chrome's current implementation of the Test API is as a (not-shipped) JavaScript polyfill that requires some extra flags that should not be set by a user. We don't currently have any plans to switch away from this model to something that could be enabled for an extension. Chrome is currently working to support OpenXr, which may have different emulatable options.

takahirox commented 4 years ago

Hi, thanks for the comment. That's sad that you Google don't currently have plan to expose to browser extension. Where is the best place to discuss in more detail? Chromium forum?

alcooper91 commented 4 years ago

I'm not sure of the best place to follow up; if the linked group is not the best place my hope would be that someone on there can direct you to the right place.

takahirox commented 4 years ago

I see, thanks!

Manishearth commented 4 years ago

I'll also mention: while the current API is mostly frozen, if it's going to be backwards compatibly standardized in some form there's some work that needs to be done. Not a ton, but some.