Last active
September 17, 2015 15:55
-
-
Save ViktorAndonov/deec4340cd7659fdce85 to your computer and use it in GitHub Desktop.
Test if to see what users uses Mac or PC (in JS)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var OSName="Unknown OS"; | |
if (navigator.appVersion.indexOf("Win")!=-1) OSName="Windows"; | |
else if (navigator.appVersion.indexOf("Mac")!=-1) OSName="MacOS"; | |
else if (navigator.appVersion.indexOf("X11")!=-1) OSName="UNIX"; | |
else if (navigator.appVersion.indexOf("Linux")!=-1) OSName="Linux"; | |
console.log('Your OS is: '+OSName); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment