Skip to content
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

Allow Window's focus() API to focus opener #109

Merged
merged 3 commits into from Feb 14, 2024
Merged

Conversation

steimelchrome
Copy link
Collaborator

This allows websites to use opener.focus() to give focus to the opener tab from the picture-in-picture window.

Fixes #94

spec.bs Show resolved Hide resolved
spec.bs Outdated Show resolved Hide resolved
spec.bs Show resolved Hide resolved
1. Let |pipWindow| be |current|'s <a>active window</a>'s
<a>documentPictureInPicture API</a>'s <a>last-opened window</a>.
2. If |pipWindow| is not <code>null</code> and |pipWindow|'s <a>relevant global object</a>
has <a>transient activation</a>, then:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to raise an Exception to inform developer focus() requires a user gesture from a PiP window.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that focus() is still technically usable regardless, you just wouldn't get system-level focus in this case. It would essentially mean any time a window that owns a pip window calls window.focus() (or another window calls focus() on it), they'd get a new error despite otherwise having the same functionality as before

@steimelchrome steimelchrome merged commit db706dc into main Feb 14, 2024
2 checks passed
@steimelchrome steimelchrome deleted the window-focus branch February 14, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support invoking "back to tab" programmatically
2 participants