Wait for focus before proceeding for enumerateDevices() Promises.
Categories
(Core :: WebRTC: Audio/Video, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: karlt, Assigned: karlt)
References
Details
Attachments
(8 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
The enumerateDevices()
specification has changed so that it "MUST wait" for "fully active and focus" to proceed if a getUserMedia()
request has not yet been granted.
If a getUserMedia()
request has been granted, then "The User Agent MAY wait to proceed to the next step until document is fully active and has focus." This would provide better protection against fingerprinting and is simpler to implement given that the wait is required in some circumstances, so this is my planned approach.
Comment hidden (typo) |
Assignee | ||
Comment 2•3 years ago
|
||
This could and perhaps should have been in wpt from the start, but there is
more benefit from the wpt harness when enumerateDevices() correctly implements
the requirement to wait for focus.
Gecko crashtests do not run with the "focusmanager.testmode" pref set and so
are easily affected by changes in OS focus. Wpt tests are run with this pref
set to emulate focus in some situations where OS focus is not available.
Some Gecko crashtests such as dom/html/crashtests/1667493.html create new
windows which can cause the OS to move focus, which does not necessarily
return after the window is closed. This can even confuse Gecko
"focusmanager.testmode" focus emulation, but wpt resets the emulated focus
between tests and so is less affected by this.
Assignee | ||
Comment 3•3 years ago
|
||
https://github.com/w3c/mediacapture-main/pull/574
Depends on D127044
Assignee | ||
Comment 4•3 years ago
|
||
Gecko and WebKit browsers use a persisted salvageable document in history and
so the promise resolves when the document becomes active again.
Blink does not currently persist documents for bfcache, but this is planned
https://www.chromestatus.com/feature/5815270035685376
https://www.chromestatus.com/feature/6279906713403392
Depends on D127045
Assignee | ||
Comment 5•3 years ago
|
||
Depends on D127046
Assignee | ||
Comment 6•3 years ago
|
||
Depends on D127047
Assignee | ||
Comment 7•3 years ago
|
||
This will simplify data structures for pending enumerateDevices() operations.
The subject principal was added for
https://bugzilla.mozilla.org/show_bug.cgi?id=1372073#c28
I don't see any current chrome callers, but chrome should be able to call this
method on a chrome document for real values. Chrome should have no need
to call this on a content document.
Depends on D127048
Assignee | ||
Comment 8•3 years ago
|
||
Depends on D127049
Assignee | ||
Comment 9•3 years ago
|
||
https://github.com/w3c/mediacapture-main/pull/574
Focus on browser chrome widgets is accepted provided the tab is fully active
and foreground.
https://github.com/w3c/mediacapture-main/issues/752#issuecomment-742036800
Depends on D127050
Comment 10•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Comment 12•3 years ago
|
||
bugherder |
Comment 13•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Comment 14•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/68a2bed5da24
https://hg.mozilla.org/mozilla-central/rev/18ada14fa683
https://hg.mozilla.org/mozilla-central/rev/a2538bf509b9
https://hg.mozilla.org/mozilla-central/rev/3e347b20ef36
Comment 16•3 years ago
•
|
||
I was looking for enumerateDevices-without-focus.https.html upstream and couldn't find it. This brought me here.
It looks like the patches landing in two batches here (comment 10 and comment 13) confused the WPT upstream bot to fire in comment 11, missing the patches in comment 13 entirely, causing those tests to never have been upstreamed.
We should rectify this. Also, do we have an automation problem here, or was this a snafu from the leave open flag not getting set in time?
Updated•3 years ago
|
Comment 17•3 years ago
|
||
https://searchfox.org/mozilla-central/source/testing/web-platform/mozilla/tests/mediacapture-streams/enumerateDevices-without-focus.https.html is under testing/web-platform/mozilla/tests
and so doesn't get synced. testing/web-platform/tests/mediacapture-streams/enumerateDevices-with-navigation.https.html did get synced, so I think this worked as intended from a sync point of view.
Assignee | ||
Updated•3 years ago
|
Description
•