Fired on a specific screen when any property of the screen changes — width or height, available width or available height, color depth, or orientation, screen position and available screen position, device pixel ratio, label or screen's designation.
Examples
When Window.getScreenDetails() is invoked, the user will be asked for permission to manage windows on all their displays (the status of this permission can be checked using Permissions.query() to query window-management). Provided they grant permission, the resulting ScreenDetails object contains ScreenDetailed objects representing all the screens available to the user's system.
The following example opens a window in the top-left corner of the OS primary screen:
js
// Return ScreenDetailsconst allScreens =await window.getScreenDetails();// Return the primary screen ScreenDetailed objectconst primaryScreenDetailed = allScreens.screens.find((screenDetailed)=> screenDetailed.isPrimary,);// Open a window in the top-left corner of the OS primary screen
window.open("https://example.com","_blank",`left=${primaryScreenDetailed.availLeft},
top=${primaryScreenDetailed.availTop},
width=200,
height=200`,);