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

Adopt the Multi-Screen Window Placement API in bespoke template #439

Open
yhatt opened this issue Apr 2, 2022 · 2 comments
Open

Adopt the Multi-Screen Window Placement API in bespoke template #439

yhatt opened this issue Apr 2, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@yhatt
Copy link
Member

yhatt commented Apr 2, 2022

Google Chrome 💯 has implemented Multi-Screen Window Placement API. It definitely matches to Marp's use case, the presenter view of Marp CLI's bespoke template.

  • Slideshow apps can show speaker notes on the internal primary screen and the presentation on an external projector.

https://web.dev/multi-screen-window-placement/#use-cases

@yhatt yhatt added the enhancement New feature or request label Apr 2, 2022
@yhatt
Copy link
Member Author

yhatt commented Apr 2, 2022

Powered by the Multi-Screen Window Placement API, I've tried to implement a new behavior of "Open presenter view" button, for opening the presenter view into the current screen as an external window and making start the main view full screen into external screen at the same time.

However, I found both of operations cannot do at once with one click of the button. There are no workarounds because they are restrictions due to security reason.

If opened a window by window.open() first, requestFullscreen() gives up making the slide fullscreen with an error "cannot be initiated without a user gesture".

If run requestFullscreen() first, the browser will block opening a new window by window.open(). Users can permit opening the pop-up window from the browser notification, but I'm thinking it is hard to notice that because it has delivered quietly.

In addition, the Multi-Screen Window Placement API shows users the prompt to grant a permission. In the case of local HTML file (Marp's primary use), the browser will ask the permission each time of opening presenter view. Compared to the current behavior, users may feel irritated to the new behavior.

@yhatt
Copy link
Member Author

yhatt commented May 31, 2022

https://chromestatus.com/feature/5173162437246976
WindowPlacementFullscreenCompanionWindow flag has been implemented in Chrome 103 and later. The first concern may resolve by this flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant