support
support copied to clipboard
Incorrect screen.width and screen.height values
The Samsung browser provides incorrect values for screen.width and screen.height, while window.devicePixelRatio is correct.
For the Galaxy S10, the reported values are:
Portrait mode: 980×1576
Landscape mode: 980×453
Dividing these values gives:
1576 / 980 = 1.61
980 / 453 = 2.16
This means that the screen appears to stretch when rotated by 90 degrees, or that the pixels are rectangular.
The actual resolution of this phone is 1440×3040:
3040 / 1440 = 2.11, which differs from 1.61 and 2.16.
Providing incorrect values prevents proper scaling of fullscreen applications, such as mapping portals.
Below are the values from Chrome:
Portrait mode: 360×760
Landscape mode: 760×360
As seen, rotation does not affect the pixel count. The ratio:
760 / 360 = 2.11, which exactly matches the S10 screen proportions.
I also tested this on the Galaxy S22, and the same issues occur.
Please correct the returned values to match those in Chrome.