Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Lion (OS X 10.7) in javascript?

Is there a way to detect if the operating system is OS X Lion or not in Javascript?

Cheers!

like image 645
MintDeparture Avatar asked Oct 09 '11 19:10

MintDeparture


People also ask

Can I still use Mac OS X Lion?

Some people are still using OS X 10.7 Lion and OS X 10.8 Mountain Lion, and until recently, you had to pay Apple $19.99 to get download codes for those OSes. But there's good news: Apple is now offering Lion and Mountain Lion for free for anyone who wants them.

What version is OS X Lion?

What is OS X Lion? OS X Lion (version 10.7) is an operating system designed by Apple and released in 2011. It is generally used with Apple Macintosh computers (Macs).

What number is Mac OS X Lion?

Mac OS X Lion (version 10.7; marketed as OS X Lion) is the eighth major release of Mac OS X, Apple's desktop and server operating system for Macintosh computers.


1 Answers

The user agent of Safari (and also Firefox) in Lion is something like

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3

There is "Mac OS X 10_7_1" in it - this indicates Lion (= Mac OS 10.7).

See here: http://www.whatsmyuseragent.com/

You can read the user agent string using "navigator.userAgent"

like image 73
Krumelur Avatar answered Sep 30 '22 14:09

Krumelur