mediacapture-main icon indicating copy to clipboard operation
mediacapture-main copied to clipboard

Device enumeration spec-ed to hang

Open eladalon1983 opened this issue 3 years ago • 5 comments

  1. The User Agent MUST wait to proceed to the next step until device enumeration can proceed is true .

But the device enumeration can proceed check can return false, in which case... we should hang indefinitely? This does not seem to match the implementation in Chromium, Safari or Firefox. It also seems unreasonable. Am I misreading this?

eladalon1983 avatar Sep 22 '22 16:09 eladalon1983

This is a parallel step, so the browser doesn't hang. The promise is just not settled yet.

Firefox waits until "the relevant global object's associated Document is fully active" and the browser window has OS-level focus.

karlt avatar Sep 22 '22 18:09 karlt

Not settling the promise means the following code would "hang", in that it never continues execution past await:

const devices = await navigator.mediaDevices.enumerateDevices();
doUsefulThings(devices);

No implementation I aware of actually follows this algorithm. The promise is settled in all of them.

eladalon1983 avatar Sep 23 '22 08:09 eladalon1983

Seems like we need to have an UMA to figure out whether this anti-tracking feature will break websites.

alvestrand avatar Sep 29 '22 14:09 alvestrand

Firefox implemented this a year ago.

Not continuing execution past await is not a "hang", so there is no issue here, nor is this new information to reopen our previous decision. I suggest closing it.

jan-ivar avatar Sep 29 '22 21:09 jan-ivar

I filed https://bugs.webkit.org/show_bug.cgi?id=245864 to keep track of this work in WebKit.

youennf avatar Sep 30 '22 06:09 youennf

Substantive discussion seems to be occuring in #905. Closing this as a duplicate thread.

alvestrand avatar Oct 27 '22 15:10 alvestrand