diff --git a/src/bowser.js b/src/bowser.js index 2df0d2e..0cf0818 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -27,7 +27,7 @@ , ipad = /ipad/i.test(ua) , touchpad = /touchpad/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) , gecko = /gecko\//i.test(ua) , seamonkey = /seamonkey\//i.test(ua) @@ -41,6 +41,10 @@ msie: t , 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 { webkit: t , chrome: t @@ -81,10 +85,6 @@ , safari: t , version: ua.match(webkitVersion)[1] } - if (opera) return { - opera: t - , version: ua.match(webkitVersion)[1] - } if (gecko) { o = { gecko: t