javascriptbrowserwindowbuilt-in-types

Does the window.screen object include the entire browser window in or just the same inner part of it (web page)


I want to know if the window.screen object includes the whole screen of the device, including browser window and so on Or it’s only the demarcated part for web page interaction? And how different is it from the document object module?


Solution

  • Let's have a look at the window.screen object:

    Screen {availWidth: 1920, availHeight: 1040, width: 1920, height: 1080, colorDepth: 24, …}
    availHeight: 1040
    availLeft: 0
    availTop: 0
    availWidth: 1920
    colorDepth: 24
    height: 1080
    orientation: ScreenOrientation {angle: 0, type: "landscape-primary", onchange: null}
    pixelDepth: 24
    width: 1920
    __proto__: Screen
    

    This is what I've got in my chrome browser. (My Screen is of 1920px/1080px)

    As it's seen, we've got various members of Screen including full height, width and also the available ones. availableHeight defers for the browser's heading/navigating stuffs.

    https://www.w3schools.com/js/js_window_screen.asp