-
Notifications
You must be signed in to change notification settings - Fork 16
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
Enforcing user gesture for getUserMedia #11
Comments
One case where we could enforce user gesture is the following:
We could try to enforce that a user gesture is required to call getUserMedia whenever user previously denied getUserMedia access for a given page. |
This (is permission-model specific, but) would be more permissive than today, where Safari and Firefox block temporarily, while Chrome blocks permanently. Why would we remove the only disincentive to spamming on pageload? To me, the case for user activation has to do with navigating to a room on a site already granted persistent permission. An interim solution there would be to ignore persistent grants when user activation is not used (always prompt). This would let sites migrate on their own time. |
Complication: I'm sensitive to the number of clicks it takes to get into a call (one vs two), and would like to not penalize privacy sensitive users more (or browsers with privacy sensitive defaults). How about something like: "The user agent MUST ignore persisted permissions unless the method was triggered by user activation"? This would mitigate the live cam room dive, but also be highly backwards compatible (more prompts, but interestingly the same number of clicks). |
If the browser supports querying for whether you have permission or not, the page can tell that it's not getting the device because permission is "denied" - at least when it's for all devices. (Without enumerateDevices, he can't find the ID to figure out which specific devices to ask about, so if the individual device is denied, the page has a Hard Problem.) If any page action allows the page to prompt after being initially denied, this offers the possibility of trapping the user in "request until allowed" loops - which is a Bad Thing. No needs to mean no. |
VI discussion: user-agent dependent at this stage, no interest in standardizing behavior on this at this stage |
Reopening issue. |
We could restrict this to something like: |
FWIW, we are contemplating allowing a web page to know whether calling getUserMedia will trigger a prompt or be granted. |
My requirement is that if permission has been previously granted, it MUST be possible to enter a videoconference without a prompt. |
That seems fine by me if we add the following words to your sentence "as long as user clicks on the page". Is this fine with you?
From my experience of websites supporting Safari, they do not switch to a new page. Several websites supporting Safari call getUserMedia when loading the page or shortly after loading the page without a user gesture. This usually ends up triggering a prompt in Safari, except if users opt-in to always grant. To keep being unprompted when user grants persistent access, these websites would have to adapt, for instance by using one of the following flow:
As of determining whether a user gesture is still available after a page switch, I am not sure that the definition of 'user gesture' is consistent across browsers. I am not sure we can be very precise one way or the other. Safari implementation would not allow this for instance. I don't know what other browsers do. I know some ideas (maybe implementation as well) have been discussed to pass a user gesture through postMessage. |
@jan-ivar mentioned the case of the potential issue of websites like jsfiddle getting persistent camera access, thus making any application able to potentially get camera access by navigating to a specific jsfiddle. This seems especially easy if Permission API returns 'granted'. |
Iceboxed PR: w3c/mediacapture-main#666 |
Question:
How should this interact with the permissions API? I think the user agent should not resolve "granted" via |
@q-alex-zhao Using
In Firefox, we do not implement query for camera and microphone for the reason I gave. If we end up doing so, our plan is to return By default, our prompts do not persist access, or permanently block your site if the user declines, and users who have granted access in the past are much less likely to block permission to sites, or be confused about how prompts work. |
Wouldn't that be counter-intuitive, when the permissions API says one way and the actual browser behavior is the opposite? Or maybe the user gesture requirement should work similar to the focus requirement, i.e. have |
@q-alex-zhao The opposite of
That's an interesting idea, but it might not be obvious to users that others cannot see them, or that the fix is to click anywhere on the page. |
Another edge case came up:
Thanks in advance for the clarification. |
@q-alex-zhao Any gesture requirement isn't tied to prompts, but to the request (which might be granted without prompt). So when you ask "should this prompt?", do you mean "should this prompt or automatically grant capture from Camera2, depending on whether the site has permission"? So far, only Firefox has per-device permissions, so the latter would be common. We don't know why the user unplugged Camera1, but it may be a strong signal to stop capture. So requiring user gesture sounds like it would be an improvement in that case (to avoid someone thinking they can't be seen when they can, because they didn't unplug all their cameras). |
Ideally getUserMedia would require a user gesture similarly to getDisplayMedia.
This is not web-compatible as many pages call getUserMedia on page load or quickly after page load.
It would still be nice to define web-compatible heuristics where user gesture could be enforced.
The text was updated successfully, but these errors were encountered: