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

Should getDisplayMedia be functional in SecureContext only? #77

Closed
youennf opened this issue Sep 12, 2018 · 9 comments
Closed

Should getDisplayMedia be functional in SecureContext only? #77

youennf opened this issue Sep 12, 2018 · 9 comments

Comments

@youennf
Copy link
Collaborator

youennf commented Sep 12, 2018

Following on w3c/webrtc-pc#1945, the question is whether to mandate secure origins for getDisplayMedia.
We could:

  • Mandate to reject getDisplayMedia promise for non secure origins
  • Make getDisplayMedia SecureContext
@alvestrand
Copy link
Contributor

Are these two alternatives?
I think I'd prefer the second, because it's simpler, and corresponds to a lot of other API behaviors.

@youennf
Copy link
Collaborator Author

youennf commented Sep 12, 2018

These are alternatives.
I also tend to prefer the second although the first is consistent with existing getUserMedia behavior.
In a perfect world, we could envision moving back getDisplayMedia to navigator.mediaDevices and make mediaDevices SecureContext.

@martinthomson
Copy link
Member

I also prefer the second.

@jan-ivar
Copy link
Member

What are the behavioral differences from this choice?

  1. ("getDisplayMedia" in navigator) is false, e.g. throws TypeError: ... not a function vs.
  2. Rejects promise with some error? vs.
  3. something else?

Where "some error" is what, SecurityError, NotAllowedError, NotSupportedError?

Neither Feature Policy nor the Permissions spec seem to mention specific errors.

@jan-ivar
Copy link
Member

It's 1.

"An interface, namespace, or member construct is exposed" in an insecure context if it's available in both secure and non secure contexts, which boils down to [SecureContext] in WebIDL.

@jan-ivar
Copy link
Member

Make getDisplayMedia SecureContext

Makes sense to me. This is a new powerful method.

@cynthia
Copy link
Member

cynthia commented Oct 30, 2018

Ping if there was any consensus/decision on this.

@jan-ivar
Copy link
Member

Yes, see w3c/mediacapture-main#540 (comment).

@jan-ivar
Copy link
Member

Fixed by #86.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants