Created
October 17, 2011 21:00
-
-
Save bdesham/1293792 to your computer and use it in GitHub Desktop.
Get the Mac OS X version from a Dashcode (JavaScript) app
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
// return the version of OS X in an array, e.g. a[0] = 10, a[1] = 2, a[2] = 2 | |
function get_macosx_version() | |
{ | |
var re = new RegExp(".+Mac OS X (\\d+)_(\\d+)_(\\d+)\\).+"); | |
var match = re.exec(navigator.appVersion); | |
return [parseInt(match[1]), parseInt(match[2]), parseInt(match[3])]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment