This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
* Some parts of this feature may have varying levels of support.
The Screen interface represents a screen, usually the one on which the current window is being rendered, and is obtained using window.screen.
Note that browsers determine which screen to report as current by detecting which screen has the center of the browser window.
Also inherits properties from its parent EventTarget.
Screen.availHeightSpecifies the height of the screen, in pixels, minus permanent or semipermanent user interface features displayed by the operating system, such as the Taskbar on Windows.
Screen.availWidthReturns the amount of horizontal space in pixels available to the window.
Screen.colorDepthReturns the color depth of the screen.
Screen.heightReturns the height of the screen in pixels.
Screen.isExtended Experimental Secure context
Returns true if the user's device has multiple screens, and false if not.
Screen.orientationReturns the ScreenOrientation instance associated with this screen.
Screen.pixelDepthGets the bit depth of the screen.
Screen.widthReturns the width of the screen.
Screen.mozEnabled Non-standard Deprecated
Boolean. Setting to false will turn off the device's screen.
Screen.mozBrightness Non-standard Deprecated
Controls the brightness of a device's screen. A double between 0 and 1.0 is expected.
The following properties are specified as part of the Window Management API, which makes them available on the ScreenDetailed interface; this is where we have chosen to document them. However, non-standard versions of these properties are available on the Screen interface in browsers that don't support that API. See this page's Browser compatibility table for details of the non-standard support.
Screen.availLeft Read only Non-standard Secure context
A number representing the x-coordinate (left-hand edge) of the available screen area.
Screen.availTop Read only Non-standard Secure context
A number representing the y-coordinate (top edge) of the available screen area.
Screen.left Read only Non-standard Secure context
A number representing the x-coordinate (left-hand edge) of the total screen area.
Screen.top Read only Non-standard Deprecated Secure context
A number representing the y-coordinate (top edge) of the total screen area.
Also inherits methods from its parent EventTarget.
Screen.lockOrientation Deprecated
Lock the screen orientation (only works in fullscreen or for installed apps)
Screen.unlockOrientation Deprecated
Unlock the screen orientation (only works in fullscreen or for installed apps)
change Experimental Secure context
Fired on a specific screen when it changes in some way — width or height, available width or height, color depth, or orientation.
orientationchange Deprecated Non-standard
Fires when the screen orientation changes.
if (screen.colorDepth < 8) {
// use low-color version of page
} else {
// use regular, colorful page
}
| Specification |
|---|
| CSSOM View Module> # the-screen-interface> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
Screen |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
availHeight |
1 | 12Always reflects the main screen. |
1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
availLeft |
1 | 79 | 1 | 15 | 1 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
availTop |
1 | 79 | 1 | 15 | 1 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
availWidth |
1 | 12Always reflects the main screen. |
1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
change_event |
100 | 100 | No | 86 | No | 100 | No | 69 | No | 19.0 | 100 | No |
colorDepth |
1Starting with version 59 this property is no longer required to always return 24. |
12 | 1 | ≤12.1 | 1 | 18Starting with version 59 this property is no longer required to always return 24. |
4 | ≤12.1 | 1 | 1.0Starting with Samsung Internet 7.0 this property is no longer required to always return 24. |
4.4Starting with version 59 this property is no longer required to always return 24. |
1 |
height |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
isExtended |
100 | 100 | No | 86 | No | 100 | No | 69 | No | 19.0 | 100 | No |
left |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
lockOrientation |
No | 12–79 | 14 | No | No | No | 14 | No | No | No | No | No |
mozBrightness |
No | No | 12 | No | No | No | No | No | No | No | No | No |
mozEnabled |
No | No | 12 | No | No | No | No | No | No | No | No | No |
orientation |
38 | 7912Edge does not return anOrientation object; instead, it returns the orientation type as a string. |
4314 | 25 | 16.4 | 39 | 4314 | 26 | 16.4 | 4.0 | 39 | 16.4 |
orientationchange_event |
No | 12–79 | No | No | No | No | 14 | No | No | No | No | No |
pixelDepth |
1Starting with version 59 this property is no longer required to always return 24. |
12 | 1 | ≤12.1 | 1 | 18Starting with version 59 this property is no longer required to always return 24. |
4 | ≤12.1 | 1 | 1.0Starting with Samsung Internet 7.0 this property is no longer required to always return 24. |
4.4Starting with version 59 this property is no longer required to always return 24. |
1 |
top |
No | No | 1 | No | No | No | 4 | No | No | No | No | No |
unlockOrientation |
No | 12–79 | 14 | No | No | No | 14 | No | No | No | No | No |
width |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Screen