After exploring the API named screen
and visiting this documentation link, my initial anticipation was that I would receive information regarding actual screen size pixels.
https://developer.mozilla.org/en-US/docs/Web/API/Screen/width
https://i.sstatic.net/KJ0ZI.png
However, upon conducting various tests, it appears that the values returned are actually in CSS pixels.
The value of
360
is displayed forwindow.screen.width
on my Galaxy A5 device (using both Chrome and Firefox).The value of
768
is shown forwindow.screen.width
on my iPad (via both Chrome and Safari).
These values correspond to CSS pixel measurements.
INQUIRY
Are these results consistent across different browsers? Can I rely on consistently receiving CSS pixel values?