]> source.dussan.org Git - jquery.git/commitdiff
Get browser version rather than rendering engine version.
authorDave Methvin <dave.methvin@gmail.com>
Wed, 9 Dec 2009 03:46:07 +0000 (11:46 +0800)
committerJohn Resig <jeresig@gmail.com>
Wed, 9 Dec 2009 06:43:18 +0000 (14:43 +0800)
Don't recognize Chrome as Safari.
See results of different userAgent strings here:
http://spreadsheets.google.com/ccc?key=0Aj5JJFjq9rZDdHdxXzRLVnY0SzFpRTBOUDc4VmhzRVE

src/core.js

index 8c623632daf3f4b51427ef7d66ad19e916d5f79c..81779fdb20910dc5947831774cdc8a7af1b668bd 100644 (file)
@@ -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 )