title: OS Detection in javascript for all the devices and cross-browser
body: <p>I am working on web analytics, I have to find out the <code>os</code> of the visitor specific with following conditions</p>
  
  <p>1.Cross-browser compatibility.</p>
  
  <p>2.For all devices(tablet,iphone,mobile,deskstop,etc).</p>
  
  <p>3.Maximum possible accuracy.</p>
  
  <p>I have referred some questions <a href="https://stackoverflow.com/questions/7044944/jquery-javascript-to-detect-os-without-a-plugin">regarding os detection</a>, Answer is <code>navigator.platform</code> but it does <a href="http://mscerts.programming4.us/programming/coding%20javascript%20for%20mobile%20browsers%20%28part%204%29.aspx" rel="nofollow noreferrer">not supported for some devices</a></p>
  
  <p><code>Note:</code> we cannot rely on useragent as well.</p>
  
  <p>Any suggestion will be greatful.</p>