-
Notifications
You must be signed in to change notification settings - Fork 28
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
Suggest User Agents treat a captured tab as visible #307
Comments
@youennf did you check if the captured tab's visibility was tied to the capturing tab's visibility? To determine whether it should be normative or not might depend on whether this would be considered JS observable or not, which seems debatable. While thinking through a WPT test for this — instrument self-capture and then window.open() another tab and to see if focus still is lost — is when it occurred to me it would make sense for the visibility to be inherited, which would make the WPT not work. So maybe this is not observable, and we should just describe it as best practice? |
As to whether this should include broader guidance against leaking that a tab is being captured, discuss. |
I didn't, given it can be sent to remote peers, my guess it that it does not depend on the capturing tab's visibility.
This is JS observable via
If there is no guidance, I think it is worth adding a section describing the potential issues. |
Slides for Jan 21 meeting suggest to expand the scope of this issue to include Window. I think that's unwise, given that capturing a Window is capturing the application at OS level, and we don't have special considerations for browsers when doing that; it's not even clear that we can have. With tab capture, it is obvious how to connect the signalling path. |
For window, there is indeed tighter integration with the OS. |
The suggestion in Slides for Jan 21 meeting makes sense to me. I think it'd make sense to stick to tabs for now; capturing a window that happens to be a browser window is interesting, but there is no immediate use case that requires a decision here, allowing us more time to think. |
This seems like a purely technical distinction. Tabs and windows seem interchangeable to most users. All browsers today allow users to drag loose a tab into its own window, or collapse windows back to adjacent tabs. I think we should capture this intent in the spec. Happy to discuss SHOULD vs MUST. FWIW Firefox is aware of capturing its own window, even showing a warning in its permission prompt (on platforms without integrated pickers). |
When we capture from the "window" list in Chrome, we are doing a window capture. (And Chrome doesn't produce frames from a window capture if the window's minimized) |
I'm happy we seem to have agreement on a MUST specifically for tab capture. There was pushback in the meeting on window capture, so I wanted to explain how I got there, to see if we can continue discussion on that part.
If I right-click on this fiddle link and open it in a new browser window, it'll dump I found two ways to make it emit
document.visibilityState = "visible"
document.visibilityState = "visible"
document.visibilityState = "hidden"
document.visibilityState = "hidden" So the user agent is aware the page is hidden in both cases. If it's also aware of its browser window being captured by itself (like Firefox is), then is there a reason Firefox couldn't emit Is the OS throttling the window process in the second case? If so, that might be a convincing argument to not emit |
|
As I said during the meeting, I hope we can write a guideline that would apply to all display surfaces.
I would tend to prefer should here since this is mostly about quality of experience, and tradeoffs may vary from one UA to the other, or from one OS to the other. |
Level of throttling might differ too. Keeping it guideline-level would leave UAs valuable discretion here. |
The OP says it's also about ensuring that the surface control API is not leaking that a tab is being captured. For instance, the following output from https://jsfiddle.net/jib1/519jp0ht/show would reveal the tab is likely being captured:
|
It is worth mentioning that specific point in the privacy section. |
I think we can enforce it in w3c/mediacapture-surface-control#42 (comment).
This sounds reasonable, except throttling is more of a UA optimization. Can we express it without that? Based on this note in html: ...maybe we should express it relative to the document's visibility state instead? Happy to review a PR. |
This issue had an associated resolution in WebRTC January 2025 meeting – 21 January 2025 (Suggest User Agents treat a captured tab as visible):
|
From @youennf in w3c/mediacapture-surface-control#42:
Chrome's behavior here seems desirable, so we might want to capture it in the spec, as either mandate or best practice.
The text was updated successfully, but these errors were encountered: