How can I detect the Mac OS version in JavaScript?

I know how to detect the OS (e.g. Mac or Win) using navigator.userAgent, but I need a way to know the OSX "version" that the user is running.

Posted on Feb 4, 2007 12:06 AM

Reply
7 replies

Feb 4, 2007 8:21 PM in response to MyPluto

I don't hink there is a way. JavaScript is abstracted from the OS and I don't think that OS version is accessible.

The closest you can get is the application version, which partly matches the OS version - Safari isn't usually distributed separately, so you may be able to map Safari versions to the OS version it was released with.

Feb 5, 2007 5:23 PM in response to Camelot

I was referning to JavaScript and yes JavaScript has the ability to perform complicated tasks and after all, it is a scripting language which has the ability to read environment variables so why can you not obtain it, even the browser has the ability to tell what the OS version is so why can this not be performed by his JavaScript?

Time is not a browser variable yet I have javascripts that interactively generate a real-time digital clock that continues to update after the page has completed performing it's task or are you implyingthat there are some exceptions to this rule and that obtaining the OS version is one of the exceptions.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I detect the Mac OS version in JavaScript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.