Re: [mediacapture-screen-share] Wait for fully-active and has focus. (#192)

> Could you please clarify what was lost and why it should be restored?

gDM used to be built on top of gUM (inheriting its focus requirement), until I split gDM out into its own algorithm in https://github.com/w3c/mediacapture-screen-share/pull/73.

But since gDM, ulike gUM, required "[triggered by user activation](https://github.com/whatwg/html/commit/8f8c1f50158736b3cf16188377a0974a20367c8b)" (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.

> Is this really a problem?

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.

> > making [crbug 920733](https://bugs.chromium.org/p/chromium/issues/detail?id=920733) a spec violation again
> 
> Isn't the requirement for transient activation sufficient here? (Modulo the aforementioned timing issue.)

The timing issue could be exploited, e.g. invoke gDM from  `window.beforeunload` to show the prompt in the context of a different (more trusted) tab, like it could in crbug 920733. This PR plugs the timing hole.

> the dialog shown to the user may not steal away focus/activation from anything other than the current browsing context.

That wouldn't be a normative MAY. Replacing normative language with strong recommendation would weaken the requirement, which doesn't seem desirable to me.

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/mediacapture-screen-share/pull/192#issuecomment-922977064 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 20 September 2021 14:24:07 UTC