1

Not A Duplicate Of How to detect Safari, Chrome, IE, Firefox and Opera browser?
The other questions does not address OS detection. And it is from 2012.

I have an app that supports iOS/Android/IE9+/Firefox/Safari/Chrome, but user needs to download different binaries depends on the browser/OS type.

So on the "download" page, I need to guide user to different download URLs depend on:

  • Android(4.2+) any browser - download app from [google play store URL]
  • iOS(7+) any browser - download app from [apple app store URL]
  • IE9+/Firefox on Windows - download "plugin.exe"
  • Safari on OSX - download "plugin.pkg"
  • Chrome on Win/OSX - no need plugin download

All other browser/OS are not supported; need to notify user to either install Chrome(on Win/OSX) or use mobile app.

Question: How can I detect all these things in one web page?

Libraries I have found on Google, but not quite confident that they are the prefered way to do it.
https://github.com/bestiejs/platform.js
https://github.com/WhichBrowser/WhichBrowser

Please don't ask me to do feature detection, it is not about using an HTML5 feature.

Community
  • 1
  • 1
Reed
  • 1,567
  • 3
  • 20
  • 27
  • You link to [How to detect Safari, Chrome, IE, Firefox and Opera browser?](http://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser), but you do not specify how your question differs from it except for the specific version numbers and places you wish to link to. – David Mulder May 22 '15 at 02:40
  • @David Mulder I appreciate your help but you didn't read my question content. I need to differentiate browsers on Android/iOS/OSX/WIN. – Reed May 22 '15 at 02:44
  • Yeah, which is described in various of those answers (which are from 2014 for the record). Either way, if your problem is differentiating between operating systems it's a dupe of http://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript – David Mulder May 22 '15 at 02:47
  • @David Mulder the other QA is from 2012 as well. Three years in browser & OS is like three generations old. I can hack with user-agent string easily, but not sure about what is the latest best practice. – Reed May 22 '15 at 02:55

0 Answers0