Closed Bug 1705289 Opened 4 years ago Closed 3 years ago

Require recent user gesture for getDisplayMedia() again

Categories

(Core :: WebRTC: Audio/Video, defect, P2)

defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- wontfix
firefox89 --- wontfix
firefox90 --- wontfix
firefox91 --- wontfix
firefox92 --- wontfix
firefox93 --- fixed

People

(Reporter: karlt, Assigned: karlt)

References

(Depends on 1 open bug, Regression, )

Details

(Keywords: regression)

Attachments

(5 files)

+++ This bug was initially created as a clone of Bug #1679735 +++

"triggered by user activation" seems to have been the intention of "called from a user gesture handler", but sticky activation is what was implemented.

The spec has since loosened from "triggered by" to "transient activation".

If bug 1557174 is not fixed, then we'd need to also require the gesture there for any security benefits.

Consider supporting top-level activation for cross-origin iframes with allow="display-capture".
The purpose of the transient activation test is to require a user gesture and the precise location of the user gesture is not important.
There is precedent in Gecko for using toplevel activation, in media autoplay. "allowed to play" is user-agent determined.

This would need some adjustment to HasValidTransientUserGestureActivation() to support out of process use.

Would any host sites want to grant an iframe "display-capture" permission but restrict its getDisplayMedia() calls to a user gesture specifically on the cross-origin iframe?

The Bugbug bot thinks this bug is a defect, but please change it back in case of error.

Type: enhancement → defect
Assignee: nobody → karlt

Backed out changeset 7a50bf09d726

There was no known value in relaxing the activation constraint because it
didn't resolve the use case that was thought to have regressed, but apparently
didn't. https://bugzilla.mozilla.org/show_bug.cgi?id=1704278#c24

This restores specified behavior, which is similar to Safari.
https://github.com/w3c/mediacapture-screen-share/issues/167#issuecomment-821068685

for consistency with getDisplayMedia().

System callers are trusted to be excluded from the requirement.
The exclusion may not be strictly necessary for capture previews, but removes
any doubt and simplifies testing.

Depends on D122192

This never needed to be called directly from a handler, though a
(potentially async) call should at least be triggered by a handler.
https://hg.mozilla.org/mozilla-central/rev/4d512fa7b071#l1.19

Depends on D122193

No behavior changes.

Depends on D123559

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.

Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/056185440c81
loosen message on failure to meet getDisplayMedia() user activation requirement r=jib
https://hg.mozilla.org/integration/autoland/rev/865e8b4ab40e
use more restrictive variable declarations r=jib
https://hg.mozilla.org/integration/autoland/rev/d9e75cc820bc
Remove spurious mozMediaSource media track constraint from tests r=jib
See Also: → 1729889
Regressions: 1729889
See Also: 1729889
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: