Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the Feature Policy for provisioning access to VR from embedded content/frames #86

Closed
foolip opened this issue Sep 20, 2016 · 12 comments
Labels
feature policy All things related to Feature Policy
Milestone

Comments

@foolip
Copy link
Contributor

foolip commented Sep 20, 2016

https://html.spec.whatwg.org/multipage/embedded-content.html#allowed-to-use

The language in https://w3c.github.io/webvr/#allowvr-attribute doesn't say to traverse all frames to the top-level frame, so it's easy to circumvent by just creating an iframe with the attribute on it.

As with w3c/mediacapture-main#268 (comment) I wonder if permission delegation might work here.

@toji
Copy link
Member

toji commented Sep 20, 2016

Thanks! I intended to bring up the idea of using permission delegation (spec link for easy reference) with the other implementors today. Seems like a more forward looking path than the allowvr attribute.

@foolip
Copy link
Contributor Author

foolip commented Sep 20, 2016

Yes, I am secretly hoping that allowfullscreen will be the only attribute of this sort ever shipped, but of course if you think an allowvr still makes the most sense in the end, then that's fine.

@toji
Copy link
Member

toji commented Sep 20, 2016

My only concern is that it's not clear to me how committed the other implementing browser are to the permission delegation spec. If nobody strenuously objects, I'm happy to go that route.

@raymeskhoury
Copy link

Just a heads up that we're looking at getting this added to the initial version of Feature Policy (the permission delegation successor) right now.

@ddorwin
Copy link
Contributor

ddorwin commented Nov 24, 2016

Feature Policy seems like the general direction. See also https://groups.google.com/a/chromium.org/d/msg/blink-dev/vM3RM1OQNFU/FcuMLjVfAgAJ for implementation issues with the iframe attribute.

In the meantime, please remove the allowvr text or mark it as under reconsideration / do not implement.

@ddorwin
Copy link
Contributor

ddorwin commented Nov 24, 2016

w3c/webappsec-permissions-policy#49 tracks this on the Feature Policy side.

@cvan
Copy link
Contributor

cvan commented Jan 25, 2017

Just commenting so we don't forget that the spec needs to be updated to reflect the Feature Policy dependency. This in scope for 1.1, 1.2?

Also, do we want to call the feature vr or webvr? I say vr, per navigator.vr (#116/#152).

// vr
<iframe enable="vr" src="example.html"></iframe>
<iframe featurepolicy='{"vr": ["*"]}' src="example.html"></iframe>

// or `webvr` …
<iframe enable="webvr" src="example.html"></iframe>
<iframe featurepolicy='{"webvr": ["*"]}' src="example.html"></iframe>

On a related note, something we brought up at the last/first W3C Workshop: permission to access WebVR may want to be managed by the user/UA. If so, I'd recommend adding "vr" to the enum in the Permissions API. So, you'd invoke it like this:

navigator.permissions.query({name: 'vr'}).then(result => {
  if (result.state === 'granted') {
    // Enter VR.
  } else {
    // Unable to enter VR.
  }
  result.addEventListener('change', () => {
    if (result.state === 'granted') {
      // Can enter VR.
    } else {
      // Unable to enter VR.
    }
  });
});

@cvan cvan changed the title Use HTML's "allowed to use" or permission delegation for allowvr Use the Feature Policy for provisioning access to VR from embedded content/frames Feb 7, 2017
@clelland
Copy link

In the latest drafts for Feature Policy, you'd enable it in a cross-origin frame with something like:

<iframe allow="vr" src="https://other.com/example.html">
<iframe allow="webvr" src="https://other.com/example.html">

(depending on the final feature name), or by including an HTTP header like

FeaturePolicy: {"vr": ["*"]}

in the parent document.

Same-origin frames would be able to use VR if the parent document can.

(That shouldn't be necessary to spell out in this doc, though.)

This spec, I think, will need to declare "vr" or "webvr" to be the keyword for the WebVR feature, and that its default allowlist is ["self"] -- which will enable the feature at the top-level, but block by default in cross-origin frames.

This spec will also need to declare when to call into allowed-to-use, and what to do if that algorithm returns false -- whether navigator.vr.getDisplays() returns an empty array, or navigator.vr.getAvailability should return false as well, or something else.

@toji
Copy link
Member

toji commented Feb 24, 2017

Thanks for the update @clelland! Do you have any examples of other specs that declare the keyword and default allow list, or is this new enough syntax that it hasn't propagated out to other specs yet? (Mostly just looking for some reference material)

@clelland
Copy link

clelland commented Feb 28, 2017 via email

@cvan
Copy link
Contributor

cvan commented Mar 27, 2017

Thanks! See update here too: w3c/webappsec-permissions-policy#38 (comment)

@NellWaliczek
Copy link
Member

Addressed by w3c/webappsec-permissions-policy#49

@cwilso cwilso modified the milestones: Spec-Complete for 1.0, 1.0 Apr 30, 2019
@toji toji added the feature policy All things related to Feature Policy label Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature policy All things related to Feature Policy
Projects
None yet
Development

No branches or pull requests

8 participants