1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Update bowser.js

Added support for Opera Next detection (Opera 15.0 returned Chrome 28.0)
This commit is contained in:
Bogdan Bucur 2013-07-16 22:12:27 +03:00
parent 23545d4403
commit 6cd5d1a5c4

View File

@ -25,7 +25,7 @@
, ipad = /ipad/i.test(ua) , ipad = /ipad/i.test(ua)
, touchpad = /touchpad/i.test(ua) , touchpad = /touchpad/i.test(ua)
, android = /android/i.test(ua) , android = /android/i.test(ua)
, opera = /opera/i.test(ua) , opera = /opera/i.test(ua) || /opr/i.test(ua)
, firefox = /firefox/i.test(ua) , firefox = /firefox/i.test(ua)
, gecko = /gecko\//i.test(ua) , gecko = /gecko\//i.test(ua)
, seamonkey = /seamonkey\//i.test(ua) , seamonkey = /seamonkey\//i.test(ua)
@ -38,6 +38,10 @@
msie: t msie: t
, version: ua.match(/msie (\d+(\.\d+)?);/i)[1] , version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
} }
if (opera) return {
opera: t
, version: ua.match(webkitVersion) ? ua.match(webkitVersion)[1] : ua.match(/opr\/(\d+(\.\d+)?)/i)
}
if (chrome) return { if (chrome) return {
webkit: t webkit: t
, chrome: t , chrome: t
@ -73,10 +77,6 @@
, safari: t , safari: t
, version: ua.match(webkitVersion)[1] , version: ua.match(webkitVersion)[1]
} }
if (opera) return {
opera: t
, version: ua.match(webkitVersion)[1]
}
if (gecko) { if (gecko) {
o = { o = {
gecko: t gecko: t