Skip to content

Commit

Permalink
Clarified the use of jQuery.browser and enforced jQuery.browser.firef…
Browse files Browse the repository at this point in the history
…ox matching Firefox, after the discussion in 17791c9.
  • Loading branch information
jeresig committed Dec 9, 2009
1 parent 3ec2f1a commit 9d8bd16
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,19 +621,18 @@ jQuery.extend({
},

// Use of jQuery.browser is frowned upon.
// It's included for backwards compatibility and plugins,
// although they should work to migrate away.
// More details: http://docs.jquery.com/Utilities/jQuery.browser
browser: {
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 ),
firefox: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
firefox: /firefox/.test( userAgent )
}
});

// Deprecated
jQuery.browser.mozilla = jQuery.browser.firefox;
jQuery.browser.mozilla = /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent );

if ( indexOf ) {
jQuery.inArray = function( elem, array ) {
Expand Down

0 comments on commit 9d8bd16

Please sign in to comment.