Re: [mediacapture-main] Broken foreground detection (#752)

@eladalon1983 wrote in https://github.com/w3c/mediacapture-screen-share/pull/192 something I think is relevant to `getUserMedia`:
> If the tab is visible but unfocused (for example, two browser windows visible on the screen side by side), this would produce the difference of not invoking a prompt on the unfocused browser window+tab (until focused).
> ... Are we sure this is really preferable?

It's overly strict in that particular case, which comes up more for `getUserMedia` than `getDisplayMedia` which requires user activation (and thus focus).

This spec mandates (keyboard) focus ahead of prompting, when it might suffice that the requesting document's tab is the foreground tab in that window.

When I [tested this](https://jsfiddle.net/jib1/4xqmgbch/), Safari appeared to have a good solution that technically violates the spec: it prompts if the requesting document's tab is the foreground tab, regardless of focus, and the prompt is clearly associated with the document.

The spec should probably allow this. This suggests two tests: A "foreground" visibility test ahead of prompting, and a "foreground" + focused test before resolving, to preserve the no-prompt case.

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


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

Received on Friday, 17 September 2021 00:20:46 UTC