files/en-us/web/api/screendetailed/index.md
{{APIRef("Window Management API")}}{{SeeCompatTable}}{{securecontext_header}}
The ScreenDetailed interface of the Window Management API represents detailed information about one specific screen available to the user's device.
ScreenDetailed objects can be accessed via the {{domxref("ScreenDetails.screens")}} and {{domxref("ScreenDetails.currentScreen")}} properties.
{{InheritanceDiagram}}
Inherits properties from its parent, {{DOMxRef("Screen")}}.
Inherits events from its parent, {{DOMxRef("Screen")}}.
change {{experimental_inline}}
When {{domxref("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 {{domxref("Permissions.query()")}} to query window-management). Provided they grant permission, the resulting {{domxref("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:
// Return ScreenDetails
const allScreens = await window.getScreenDetails();
// Return the primary screen ScreenDetailed object
const 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`,
);
[!NOTE] See Multi-window learning environment for a full example (see the source code also).
{{Specifications}}
{{Compat}}