title: How to get screen's physical size (i.e. in inches)?
body: <p>I'm trying to figure out how to get the physical dimensions of a device's screen via Javascript. So far, my conclusion is that it's currently impossible, but I hope someone can prove me wrong :).</p>
  
  <p>So far I have tried to get this information by finding the device's DPI, but it seems there is no way to get the correct value here, as all devices I have tested (some HDPI &amp; XHDPI Android devices, an iPhone4S, an iPad 2 and an iPad 3) report 96DPI.</p>
  
  <p>The first method of obtaining the DPI I tried is one you can find everywhere on the internet: create a <code>div</code> with a CSS width of <code>1in</code>, get its <code>clientWidth</code> or <code>offsetWidth</code> and there's your DPI. Doesn't work, all devices report 96.</p>
  
  <p>The second method was using the <a href="http://www.w3.org/TR/css3-mediaqueries/#resolution" rel="nofollow">resolution media query</a>, something along the lines of:</p>
  
  <pre><code>for (var i=90; i &lt; 400; i++) {
      if (matchMedia('(resolution: ' + i + 'dpi)').matches) {
         return i;
      }
  }
  </code></pre>
  
  <p>I thought that was a smart solution, but unfortunately that returns 96 as well.</p>
  
  <p>Is there anything left that I can try?</p>