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

Re: [mediacapture-main] Why does `navigator.mediaDevices.enumerateDevices()` require that `Document` must have active keyboard focus? (#905)

From: juj via GitHub <sysbot+gh@w3.org>
Date: Tue, 11 Oct 2022 07:13:50 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-1274194036-1665472428-sysbot+gh@w3.org>
> As such they don't interfere with garbage collection, and no resources are "left hanging"

Sorry, maybe some confusion. I was not referring to any garbage collector dependency here, but to the general loading flow being paused/stalled from progressing on the background.

> It might be simpler to do this:

This is something I did consider at first, but I would object that is a bad and brittle design pattern to implement in user code, since it creeps in/duplicates "magic" logic from the spec, and there is then a bad race condition bug that can happen if the user immediately navigates to another page while the promise is processing. (so the JS code check would pass, but from browser POV visibility was no longer there)

That is why the request for a callback form that would actually reject if "now is not a good time". That way developers could actually write logic where they could say their intent to the API.

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

Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 11 October 2022 07:13:51 UTC

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