Re: [mediacapture-screen-share] Suggest User Agents treat a captured tab as visible (#307)

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.

> I wonder whether guidance could help in some cases though, say if browser is capturing one of its own window.

If I right-click on [this fiddle link](https://jsfiddle.net/jib1/0yb5kmcf/show) and open it in a new browser window, it'll dump `document.visibilityState` every 2 seconds .

I found two ways to make it emit `"hidden"` in all browsers (tested on mac and windows):
1. Open a new tab in that browser window, or
2. drag another larger window on top of that browser window to 100% occlude it
```js
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 `"visible"` instead?

Is the OS throttling the window process in the second case? If so, that might be a convincing argument to not emit `"visible"`, as it would backfire and potentially leak capture.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/issues/307#issuecomment-2605511354 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 21 January 2025 18:57:23 UTC