Skip to content

Commit

Permalink
Get browser version rather than rendering engine version.
Browse files Browse the repository at this point in the history
Don't recognize Chrome as Safari.
See results of different userAgent strings here:
http://spreadsheets.google.com/ccc?key=0Aj5JJFjq9rZDdHdxXzRLVnY0SzFpRTBOUDc4VmhzRVE
  • Loading branch information
dmethvin authored and jeresig committed Dec 9, 2009
1 parent 8d73fbd commit d3dc2d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ jQuery.extend({
// It's included for backwards compatibility and plugins,
// although they should work to migrate away.
browser: {
version: (/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
safari: /webkit/.test( userAgent ),
version: (/.*?(?:firefox|safari|opera|msie)[\/ ]([\d.]+)/.exec(userAgent) || [0,'0'])[1],
safari: /safari/.test( userAgent ),
opera: /opera/.test( userAgent ),
msie: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
Expand Down

1 comment on commit d3dc2d1

@thorn0
Copy link

@thorn0 thorn0 commented on d3dc2d1 Jan 14, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.