ZOMDir > Blog

Saturday, 20 June 2015

A bug in Safari?

Apple is more or less cheating about the Javascript* screensize of the iPhone 4s for a long time.

You might check this by using Browsersize at a Glance on an iPhone. This simple webpage will give you results like this:

Safari on iPhone 4s, iOS 7.1.2


Chrome on iPhone 4s, iOS 8.3
The browsersize returned isn't the real size of the iPhone 4s. According to the iPhone 4s Tech Specs  the iPhone 4s has a screen of  640 (width) by 960 (height) pixels. That Apple was "cheating" on the browsersize was never a problem for me. On the contrary I did understand that Apple pretended that the screensize is lower than the specs for backwards compatibility. After all previous models of the iPhones have a screen of 320 (width) by 480 (height) pixels.

However now I wonder why Apple states that the iPhone 4s has more pixels than in the specs. Today I got this result and I'm puzzled.


Safari on iPhone 4s, iOS 8.3

Why do I now get the default width? The only thing I have done is updating iOS, so I wonder what I have done wrong that the default width is shown. Perhaps this is a bug. 

I know this is a technical issue, so it is good to know that I have read Apple's Configuring the Viewport and I'm always using this code 

<meta name="viewport" content="width=device-width" />

in the head section of the webpage. 

Thanks,
Hans

By the way, I also wonder why there is a difference between Google's Chrome and Safari. I suppose that they are based on different versions of webkit.

* The screensize is based on the Javascript innerWidth property and the corresponding innerHeight property


--
ZOMDir.com is a dynamic directory and a wiki
Everyone is able to add a link in 10 seconds
To learn more view this Slideshare presentation