Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12242 closed bug (wontfix)

$.browser doesn't report webkit in Chrome anymore

Reported by: [email protected] Owned by:
Priority: low Milestone: None
Component: misc Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:


$.browser, when ran in Chrome and jQuery 1.7.1 reports

safari: true version: "534.11" webkit: true

In 1.8.0 it reports

chrome: true version: "21.0.1180.60"

which is correct, but it should at least include webkit: true, as it is still a WebKit-based browser. I know $.browser is deprecated, but still.

Change History (6)

comment:1 Changed 10 years ago by timmywil

Component: unfiledmisc
Priority: undecidedlow
Resolution: wontfix
Status: newclosed

I highly doubt anyone on the core team would care enough about $.browser to make sure it works beyond the current tests.

Besides, $.browser.webkit is becoming less and less useful with Chrome and Safari continually diverging their webkit codepaths.

comment:2 Changed 10 years ago by Rick Waldron

Also, in 1.9 jQuery.browser will no longer be in the core library

comment:3 Changed 10 years ago by dmethvin

This was introduced in 1.8 as a result of the new Chrome detection. So it just goes to show, no good deed goes unpunished.

I'm inclined to leave $.browser as-is since it's been deprecated since 1.3 and will be gone in 1.9. If you need to know the actual browser/version and expect to need that in the future, it would be better for you to parse navigator.userAgent directly.

comment:4 Changed 10 years ago by [email protected]

The problem is that it introduces a breaking change where it shouldn't - the rendering engine in Chrome is still Webkit regardless of the javascript engine and the 3D rendering. However, it doesn't really affect me, so it is up to jQuery to decide how to handle it, if at all.

comment:5 Changed 10 years ago by anonymous

Simple, add this to your project

jQuery.browser.webkit = !!jQuery.browser.chrome;

comment:6 in reply to:  5 Changed 10 years ago by [email protected]

More like

jQuery.browser.webkit = !!jQuery.browser.chrome || jQuery.browser.webkit;

If you want it to work in Safari/other WebKit browsers too.

Note: See TracTickets for help on using tickets.