Created
February 20, 2013 19:24
-
-
Save justinobney/4998441 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function DetectOS() { | |
var osName = "Unknown OS"; | |
var platform = navigator.platform.toUpperCase(); | |
if (platform.indexOf("WIN") != -1) osName = "Windows"; | |
if (platform.indexOf('MAC') != -1) osName = "MacOS"; | |
if (platform.indexOf("X11") != -1) osName = "UNIX"; | |
if (platform.indexOf("LINUX") != -1) osName = "Linux"; | |
return osName; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment