Two Curious Things about screen.width and screen.height on Mobile Firefox and under iOS.

& (verbiage overflow)Mon 19 January 2015RSS

I have been experimenting in my spare time with browser-fingerprinting, something that my current job deals with. Below are two curious things I have noticed.

Background: In the mobile versions of Chrome and Opera, the values of screen.width tend to be swapped with screen.height when the device's orientation toggles between portrait and landscape. And screen.availWidth is swapped with screen.availHeight at the same time.

Curious Thing One: In the mobile version of Firefox, the values are not always simply swapped; often they are changed somewhat. Relevant cases are boldfaced below.

Browser: Firefox v. 35

device & OS portrait screen.width & .availWidth landscape screen.height & .availHeight portrait screen.height & .availHeight landscape screen.width & .availWidth screen.pixelDepth & .colorDepth
Nexus 4, Android 5.0.1 384 384 592 598 24
Nexus 5, Android 5.0.1 360 360 592 598 24
Verizon Ellipsis, Android 4.4.2 600 522 912 960 24

Browser: Chrome v. 39.0.2171.93

device & OS portrait screen.width & .availWidth landscape screen.height & .availHeight portrait screen.height & .availHeight landscape screen.width & .availWidth screen.pixelDepth & .colorDepth
Nexus 4, Android 5.0.1 384 384 640 640 32
Nexus 5, Android 5.0.1 360 360 640 640 32
Verizon Ellipsis, Android 4.4.2 601 601 692 692 32

Browser: Opera v. 26.0.1656.87080

device & OS portrait screen.width & .availWidth landscape screen.height & .availHeight portrait screen.height & .availHeight landscape screen.width & .availWidth screen.pixelDepth & .colorDepth
Nexus 4, Android 5.0.1 384 384 640 640 32
Nexus 5, Android 5.0.1 360 360 640 640 32
Verizon Ellipsis, Android 4.4.2 601 601 692 692 32

Curious Thing Two: On the current version of iOS for the iPad mini, it seems that toggling the orientation is handled in such a way that screen.width and .height are not changed at all. That is, even when in landscape orientation, the width of the screen is reported as narrower than the height of the screen:

Browser: Chrome v. 39.0.2171.50:

device & OS portrait screen.width & .availWidth landscape screen.height & .availHeight portrait screen.height & .availHeight landscape screen.width & .availWidth screen.pixelDepth & .colorDepth
iPad mini, iOS 7.1.1 768 1024 (& 1004) 1024 (& 1004) 768 32

Browser: Opera v. 9.1.0.8673:

device & OS portrait screen.width & .availWidth landscape screen.height & .availHeight portrait screen.height & .availHeight landscape screen.width & .availWidth screen.pixelDepth & .colorDepth
iPad mini, iOS 7.1.1 768 (& 748) 1024 1024 768 (& 748) 32

Notes:

  1. On iOS, screen.width and screen.availWidth differ slightly in Opera, unlike on Nexus 4, Nexus 5, or Verizon Ellipsis. In Chrome, screen.height and screen.availHeight likewise differ slightly.
  2. At the time of this writing, Firefox is not available for iOS.
  3. For the iOS results, it does not seem to make a different what the orientation of the device is at startup or when the apps are launched. Clearing the browser caches and browsing history makes no difference, either.
  4. This research was done 2015.01.15-19, using one version of each reported device. I have made no attempts to confirm these results on additional versions of the devices.

[end]

Comments are enabled.