Document the new options available on the DocumentPictureInPicture.requestWindow() method by chrisdavidmills · Pull Request #36902 · mdn/content · GitHub
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

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

github-actions bot commented Nov 21, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @wbamberg. I agree with your comments — the text could have been more accurate, and it is not good to tie the description to a specific implementation. However, I still think it is useful to show what a particular example of the UI control could look like, to help the reader visualize this option's effect. Plus I spent the time making the frickin' screenshot ;-)

So, I have updated it to use your text, but I have kept the screenshot as an example of what the UI control looks like in a specific implementation, and described it clearly.

WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I still think omitting the screenshot is better but I can live with this. Thanks!

Copy link
Contributor

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

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

LGTM with existing comment

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

👍 thanks!

@wbamberg wbamberg merged commit f7ddd45 into mdn:main Nov 22, 2024
8 checks passed
@chrisdavidmills chrisdavidmills deleted the documentPictureInPicture-requestWindow-new-options branch November 23, 2024 14:34
@chrisdavidmills
Copy link
Contributor Author

Awesome, cheers @wbamberg!

(and @beaufortfrancois!)

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.

3 participants