-
Notifications
You must be signed in to change notification settings - Fork 61
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
Broken foreground detection #752
Comments
This may not cut it either, as 3 out of 4 browsers return Worse, only 1 (Firefox) out of 4 browsers appears to care about focus at all: https://jan-ivar.github.io/dummy/gum_visiblefocus.html Several specs seem in need of a similar "visible and focused" step in HTML, but it may need to be a new one. |
It's probably a stretch to call this editorial, since behavior varies in implementations. |
@eladalon1983 wrote in w3c/mediacapture-screen-share#192 something I think is relevant to
It's overly strict in that particular case, which comes up more for This spec mandates (keyboard) focus ahead of prompting, when it might suffice that the requesting document's tab is the foreground tab in that window. When I tested this, Safari appeared to have a good solution that technically violates the spec: it prompts if the requesting document's tab is the foreground tab, regardless of focus. Its prompt is also clearly associated with the document. The spec should probably allow this. This suggests two tests: A "foreground" visibility test ahead of prompting, and a "foreground" + focused test before resolving, to preserve the no-prompt case. |
…romises r=jib,nika w3c/mediacapture-main#574 Focus on browser chrome widgets is accepted provided the tab is fully active and foreground. w3c/mediacapture-main#752 (comment) Differential Revision: https://phabricator.services.mozilla.com/D127051
…romises r=jib,nika w3c/mediacapture-main#574 Focus on browser chrome widgets is accepted provided the tab is fully active and foreground. w3c/mediacapture-main#752 (comment) Differential Revision: https://phabricator.services.mozilla.com/D127051
I guess this is the same for screen sharing. I filed w3c/mediacapture-screen-share#203 |
Pinging @palak8669 |
I think this makes sense for But what would this mean for if (!bc->IsActive() || // background tab or browser window fully obscured
!bc->GetIsActiveBrowserWindow()) { // browser window without focus IOW, the same page visibility AND focus of the user agent window (not the document) check. While a focus requirement seems defensible for |
What a operating-system-window focus requirement provides The disadvantage of the focus requirement is that sometimes the presence of a device is useful for displaying items that would be visible before any user interaction. Visibility seems the preferred requirement for |
Does the platform already expose whether the current window has focus? I assume that it does, but want to confirm. Other than that, I think Karl’s argument resonates with me. The fingerprinting risk exists if the information is released under any focus condition, so we are really looking at what makes the API useful. |
Operating system window focus is exposed through "focus" and "blur" events iff the user-agent is directing keyboard events to the navigable. If the user-agent is taking keyboard events for its own widgets, then these "focus" and "blur" events are not dispatched. Gecko exposes window focus, even when the user-agent is directing keyboard events to its own widgets, through |
If you're in an iframe without focus, then there's no way to tell whether the current window has focus or not AFAIK.
Agreed. I see no time limit where the spec says: "User Agents MAY add fuzzing on the timing of events to avoid cross-origin activity correlation". |
This spec references "focus" in 8 places, e.g.: "The User Agent MUST wait to proceed to the next step until the relevant settings object's responsible document is fully active and has focus."
All are meant to ensure camera & microphone cannot be turned on from background tabs, but it doesn't work:
Other specs are in the same boat.
We need to fix whatwg/html#5049 and use the following algorithm instead of "and has focus":
The text was updated successfully, but these errors were encountered: