-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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
Document the new options available on the DocumentPictureInPicture.requestWindow() method #36902
Conversation
…equestWindow() method
Preview URLs
(comment last updated: 2024-11-22 10:33:55) |
- : 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- : 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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks!
Awesome, cheers @wbamberg! (and @beaufortfrancois!) |
Description
This PR adds documentation for two new options available to the
DocumentPictureInPicture.requestWindow()
method:disallowReturnToOpener
option. When set totrue
, 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.preferInitialWindowPlacement
option. When set totrue
, 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