You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wouldn't it be better if document PiP has it's own implementation of refocusing on main window instead of modifying window.focus() directly?
I believe some 3rd party libraries out there use window.focus on at least one of their components that hooks on common event listeners such as mouse click or keydown. Modifying window.focus would cause unwanted behaviour on these 3rd party libraries when used in PiP window, i.e. bringing the main window to focus unintendedly when they just want to use it to take notes on some videos online.
It can often be useful for the picture-in-picture window to be able to re-focus
its opener tab, e.g. when the smaller form-factor of the window doesn't fit the
experience the user needs. We modify the {{Window/focus()}} API to allow it to
take system-level focus when a picture-in-picture window is focusing its
opener.
The text was updated successfully, but these errors were encountered:
tmpmachine
changed the title
Considering 3rd party libraries implementation for opener window re-focus.
Considering 3rd party libraries implementation on modifying window.focus API
Mar 21, 2024
Wouldn't it be better if document PiP has it's own implementation of refocusing on main window instead of modifying window.focus() directly?
I believe some 3rd party libraries out there use window.focus on at least one of their components that hooks on common event listeners such as mouse click or keydown. Modifying window.focus would cause unwanted behaviour on these 3rd party libraries when used in PiP window, i.e. bringing the main window to focus unintendedly when they just want to use it to take notes on some videos online.
document-picture-in-picture/spec.bs
Line 445 in 24f7754
On the implementation side, I've issued a crbug and added a code snippet in the comment to handle this specific use case: https://issues.chromium.org/issues/330589220.
The text was updated successfully, but these errors were encountered: