W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > October 2022

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

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Thu, 27 Oct 2022 16:42:06 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-1293797299-1666888924-sysbot+gh@w3.org>
> This suggests two tests: A "foreground" visibility test ahead of prompting, and a "foreground" + focused test before resolving, to preserve the no-prompt case.

I think this makes sense for `getUserMedia`. On desktop, it seems comforting to know that other browser windows that weren't using camera or microphone when I've left them open cannot decide to turn on camera or microphone on a whim while I'm not interacting with them.

But what would this mean for `enumerateDevices`? Right now, Firefox's [check in enumerateDevices](https://searchfox.org/mozilla-central/rev/2d1097c27f31cb15f7588b043d691cda9710d14b/dom/media/MediaDevices.cpp#159,163,177-178) is:
```c++
    if (!bc->IsActive() ||  // background tab or browser window fully obscured
        !bc->GetIsActiveBrowserWindow()) {  // browser window without focus
```
IOW, the same page visibility AND focus of the user agent window (not the document) check.

While an eventual focus requirement seems defensible for `getUserMedia`, perhaps the visibility requirement alone is sufficient for enumerateDevices? There it's anti-fingerprint, not anti-spying. @karlt @youennf Thoughts?

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 27 October 2022 16:42:08 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:59 UTC