How can I detect iPhone X screen width in landscape mode?

632 views Asked by At

I've added the following javascript to my site:

alert('screen width=' + screen.width);

When I open the site on my iPhone X it outputs 'screen width=375' in both portrait and landscape mode.

I would expect it to be 812px in landscape.

I've also tried this on my iPhone XR and it has the same behaviour.

Can anyone suggest why this might be?

0

There are 0 answers