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

> 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](,163,177-178) is:
    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 using your GitHub account

Sent via github-notify-ml as configured in

Received on Thursday, 27 October 2022 16:42:08 UTC