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

Add VisualViewport.segments support data #6265

Open
aabizri opened this issue May 9, 2022 · 0 comments
Open

Add VisualViewport.segments support data #6265

aabizri opened this issue May 9, 2022 · 0 comments

Comments

@aabizri
Copy link

aabizri commented May 9, 2022

While the Visual Viewport API is already tracker (see here, as well as several of its VisualViewport's properties (including scale, width and others), segments isn't.

This property is defined by the standard: https://wicg.github.io/visual-viewport/#the-visualviewport-interface, and allows a script to query of how many and what type of segments (screen sections for foldables, screens for the Surface Duo) the display area is made of.

It is currently only supported by Edge (you can test it by checking for window.visualViewport.segments: if it is undefined then the feature is unsupported, if null then your screen is made up of only one display, if it's an array then you're on a foldable/multi-segment device (It can also be simulated in the developer tools).

Here's some documentation on the feature:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants