How can I find the OS name and OS version using JavaScript?
You can find the OS name and version in the navigator
object, as others have answered. The standard, cross-browser place to find this information is in the navigator.userAgent
property. However, user agent strings vary widely by OS and browser.
So, I created a script to encapsulate this logic and report on the most common OSes and browsers in a familiar way, like http://www.whatsmybrowser.org.
I open-sourced the script and uploaded it to github, https://github.com/keithws/browser-report. Pull requests are welcome!