ScreenDetailed

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

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 ScreenDetails.screens and ScreenDetails.currentScreen properties.

Screen ScreenDetailed

Instance properties

Inherits properties from its parent, Screen.

availLeft Read only

A number representing the x-coordinate (left-hand edge) of the available screen area.

availTop Read only

A number representing the y-coordinate (top edge) of the available screen area.

devicePixelRatio Read only

A number representing the screen's device pixel ratio.

isInternal Read only

A boolean indicating whether the screen is internal to the device or external.

isPrimary Read only

A boolean indicating whether the screen is set as the operating system (OS) primary screen or not.

label Read only

A string providing a descriptive label for the screen, for example "Built-in Retina Display".

left Read only

A number representing the x-coordinate (left-hand edge) of the total screen area.

top Read only

A number representing the y-coordinate (top edge) of the total screen area.

Events

Inherits events from its parent, Screen.

change

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 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

Specification
Window Management
# api-screendetailed-interface

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ScreenDetailed
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
availLeft
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
availTop
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
devicePixelRatio
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
isInternal
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
isPrimary
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
label
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
left
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
top
Experimental
Chrome – Full support
Chrome 100 (Release date: 2022-03-29)
footnote Full support
Edge – Full support
Edge 100 (Release date: 2022-04-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 86 (Release date: 2022-04-20)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also