index.js
function findOS(uaPlatformInfo) {
  var oses = ['Android', 'BSD', 'Linux', 'Windows', 'iPhone OS', 'Mac OS', 'BSD', 'CrOS', 'Darwin', 'Dragonfly', 'Fedora', 'Gentoo', 'Ubuntu', 'debian', 'HP-UX', 'IRIX', 'SunOS', 'Macintosh', 'Win 9x', 'Win98', 'Win95', 'WinNT'];
  for(var os in oses) {
    for(var i in uaPlatformInfo) {
      var item = uaPlatformInfo[i];
      if (contains(item, oses[os])) return item;
    }
  }
  return 'Other';
}
function findOS(uaPlatformInfo) {
  var oses = ['Android', 'BSD', 'Linux', 'Windows', 'iPhone OS', 'Mac OS', 'BSD', 'CrOS', 'Darwin', 'Dragonfly', 'Fedora', 'Gentoo', 'Ubuntu', 'debian', 'HP-UX', 'IRIX', 'SunOS', 'Macintosh', 'Win 9x', 'Win98', 'Win95', 'WinNT'];
  for(var os in oses) {
    for(var i in uaPlatformInfo) {
      var item = uaPlatformInfo[i];
      if (contains(item, oses[os])) return item;
    }
  }
  return 'Other';
}
function findOS ( uaPlatformInfo ) { var oses = [ 'Android' , 'BSD' , 'Linux' , 'Windows' , 'iPhone OS' , 'Mac OS' , 'BSD' , 'CrOS' , 'Darwin' , 'Dragonfly' , 'Fedora' , 'Gentoo' , 'Ubuntu' , 'debian' , 'HP-UX' , 'IRIX' , 'SunOS' , 'Macintosh' , 'Win 9x' , 'Win98' , 'Win95' , 'WinNT' ] ; for ( var os in oses ) { for ( var i in uaPlatformInfo ) { var item = uaPlatformInfo [ i ] ; if ( contains ( item , oses [ os ] ) ) return item ; } } return 'Other' ; }
Deduces the operating system from the user agent platform info token list.
Deduces the operating system from the user agent platform info token list .