-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reject unless fully-active and has focus. #192
Conversation
|
Not quite. There is no visibility requirement (largely because that's hard to define), so this PR affects tabs regardless of their visibility. There's a similar-sounding active document test but that's on documents inside a tab (think BFCache), so it doesn't ensure the tab itself is visible. Alas, keyboard focus is the best we have until whatwg/html#6211 is solved.
Correct.
The problem isn't specific to unprompted access. Without this PR (or something like it), nothing prevents a browser from throwing up a prompt on behalf of a background tab, which is what happened in crbug 920733.
Please ★ crbug 1163972. |
Also, this issue seems rather moot for |
I know visibility is not mentioned by the PR. I was saying that there are two scenarios in which the PR's effect can be considered - tab invisible or visible.
Thanks for bringing this one to my attention; I see what appears to be a lingering implementation issue there - that an inactive-but-visible Chrome tab can steal focus from another window using getDisplayMedia(). Which leads me to my point -
If the prompt is non-intrusive - does not steal focus and does not peek out of the borders of the window - then it is a non-issue.
If that is the case, I'd prefer a shorter spec over a long one. |
This PR restores spec-mandated behavior that was lost by mistake, making crbug 920733 a spec violation again, like it was at the time. There's no record of this regression being intentional, so fixing it seems editorial. I suggest we merge this and discuss the problem you raised in w3c/mediacapture-main#752 (comment) since it's not unique to gDM.
This is exactly what crbug 920733 did, and it was bad, because users could mistake the request as coming from the current tab, not a background tab.
Feel free to open a new issue, but note there's no precedent for specs mandating intrusiveness of prompts, and such a spec would likely be anything but short. |
Could you please clarify what was lost and why it should be restored? Reading #132 does not make it as obvious to me. Both the pre-PR and post-PR texts discuss rejecting getDisplayMedia() if called without user-interaction. The post-PR text lets the UA allow gDM in the split second right after the user interacts with the page (it's unclear to me what the pre-PR text specifies here). Is this really a problem?
Isn't the requirement for transient activation sufficient here? (Modulo the aforementioned timing issue.)
I think it would be useful to at least say that the dialog shown to the user may not steal away focus/activation from anything other than the current browsing context. The user can always alt+tab to another native app while the UA is still processing the already-approved call to |
gDM used to be built on top of gUM (inheriting its focus requirement), until I split gDM out into its own algorithm in #73. But since gDM, ulike gUM, required "triggered by user activation" (v1), gUM's focus test seemed redundant — after all, gDM had to be called directly or indirectly by a relevant user input event handler, e.g. a mouse click, so it would have focus — so we removed the redundancy using editorial discretion.
Yes the v2 model is time-based and no longer requires focus, which regressed our assumptions, and the language is no longer redundant, so we need to put it back to plug the hole.
The timing issue could be exploited, e.g. invoke gDM from
That wouldn't be a normative MAY. Replacing normative language with strong recommendation would weaken the requirement, which doesn't seem desirable to me. |
To summarize our discussion of the matter last Thursday:
|
@youennf @eladalon1983 I've updated the PR based on our discussion last Editor's meeting, to reject instead of wait. PTAL. |
Fixes #191.
Preview | Diff