Skip to main content

Bug Tracker

Side navigation

#5878 closed bug (invalid)

Opened January 20, 2010 06:37PM UTC

Closed October 10, 2010 02:58AM UTC

Chrome on Mac reports as Safari

Reported by: oliverlangan Owned by:
Priority: minor Milestone: 1.4.1
Component: core Version: 1.4
Keywords: chrome detection Cc:
Blocked by: Blocking:
Description

On Chrome/Mac, jQuery.browser.safari returns "true"

Chrome does in fact identify itself as Safari (as well as Chrome):

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.49 Safari/532.5

Attachments (0)
Change History (2)

Changed January 20, 2010 09:54PM UTC by dmethvin comment:1

...which is why nobody should depend on jQuery.browser!

If it says it's Safari, then who are we to argue?

Changed October 10, 2010 02:58AM UTC by addyosmani comment:2

keywords: → chrome detection
resolution: → invalid
status: newclosed

Bare in mind that we generally recommend using jQuery.support() for feature detection as opposed to userAgent sniffing using $.browser.

In addition to Dave's original comments, $.browser was deprecated for Safari as per http://api.jquery.com/jQuery.browser/ and it is suggested you can use navigator.userAgent to check this instead if you have to (effectively the same).

Just for the sake of completeness, I've taken another look at what Chrome is outputting, and checking the userAgent string using $.browser is probably not the most reliable way of establishing whether a browser is Chrome or not.

If you absolutely *have* to, see edeiller's comment for a Chrome detection function in the comments thread here:

http://api.jquery.com/jQuery.browser/

I'm closing this as $.browser sniffing is not something currently being recommended anymore (as far as I know).