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

Document the new options available on the DocumentPictureInPicture.requestWindow() method #36902

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chrisdavidmills
Copy link
Contributor

@chrisdavidmills chrisdavidmills commented Nov 21, 2024

Description

This PR adds documentation for two new options available to the DocumentPictureInPicture.requestWindow() method:

  • Chrome 124 adds the disallowReturnToOpener option. When set to true, it hides the "back to tab" button that by default appears in the top bar of the PIP window. See https://chromestatus.com/feature/6223347936657408.
  • Chrome 130 adds the preferInitialWindowPlacement option. When set to true, it causes the PIP window to always appear back at its default initial position and size when closed and then reopened. By default, it will reopen at its previous position and size. See https://chromestatus.com/feature/5183881532932096.

I've tested that both features work in the latest Chrome, but I've not tested exact versions in detail.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner November 21, 2024 15:30
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team November 21, 2024 15:30
@github-actions github-actions bot added the Content:WebAPI Web API docs label Nov 21, 2024
@chrisdavidmills chrisdavidmills changed the title Document the new options available on the DocumentPipctureInPicture.r… Document the new options available on the DocumentPictureInPicture.requestWindow() method Nov 21, 2024
@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Nov 21, 2024
Copy link
Contributor

Comment on lines +33 to +37
- : A boolean value; defaults to `false`. When set to `true`, it hints to the browser that it should hide the "back to tab" button, illustrated in the below image, which by default appears in the top bar of the Picture-in-Picture window.

![browser window containing an embedded video player and multiple control buttons, with a back to tab button in the top bar, highlighted with a red box](back-to-tab-button.png)

The "back to tab" button hides the window when pressed, returning focus to the spawning tab.
Copy link
Collaborator

@wbamberg wbamberg Nov 21, 2024

Choose a reason for hiding this comment

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

Suggested change
- : A boolean value; defaults to `false`. When set to `true`, it hints to the browser that it should hide the "back to tab" button, illustrated in the below image, which by default appears in the top bar of the Picture-in-Picture window.
![browser window containing an embedded video player and multiple control buttons, with a back to tab button in the top bar, highlighted with a red box](back-to-tab-button.png)
The "back to tab" button hides the window when pressed, returning focus to the spawning tab.
- : A boolean value; defaults to `false`. When set to `true`, this option hints to the browser that it should not display a UI control that enables the user to return to the original page and close the Picture-in-Picture window. Defaults to `false`.

This suggestion is more or less just from the spec. I don't think including a screenshot of one implementation of the UI is particularly useful, and I don't think "by default appears in the top bar of the Picture-in-Picture window" is accurate per spec, rather than being a description of the current Chrome implementation. Also I think the "back to tab" button hides the window isn't quite accurate: it closes the window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants