diff --git a/bowser.js b/bowser.js index 12f97fd..1bd0b18 100644 --- a/bowser.js +++ b/bowser.js @@ -42,6 +42,7 @@ , seamonkey = /seamonkey\//i.test(ua) , webkitVersion = /version\/(\d+(\.\d+)?)/i , firefoxVersion = /firefox\/(\d+(\.\d+)?)/i + , mobile = /mobile/i.test(ua) , o function detect() { @@ -61,6 +62,10 @@ , webkit: t , chrome: t , version: ua.match(/(?:chrome|crios)\/(\d+(\.\d+)?)/i)[1] + , ipad: ipad + , iphone: iphone + , ios: !!ua.match(/crios/i) + , mobile: mobile } if (phantom) return { name: 'PhantomJS' @@ -86,7 +91,7 @@ o = { name : iphone ? 'iPhone' : 'iPad' , webkit: t - , mobile: t + , mobile: iphone , ios: t , iphone: iphone , ipad: ipad @@ -135,17 +140,17 @@ // Graded Browser Support // http://developer.yahoo.com/yui/articles/gbs - if ((bowser.msie && bowser.version >= 8) || - (bowser.chrome && bowser.version >= 10) || - (bowser.firefox && bowser.version >= 4.0) || + if ((bowser.msie && bowser.version >= 9) || + (bowser.chrome && bowser.version >= 20) || + (bowser.firefox && bowser.version >= 10.0) || (bowser.safari && bowser.version >= 5) || (bowser.opera && bowser.version >= 10.0)) { bowser.a = t; } - else if ((bowser.msie && bowser.version < 8) || - (bowser.chrome && bowser.version < 10) || - (bowser.firefox && bowser.version < 4.0) || + else if ((bowser.msie && bowser.version < 9) || + (bowser.chrome && bowser.version < 20) || + (bowser.firefox && bowser.version < 10.0) || (bowser.safari && bowser.version < 5) || (bowser.opera && bowser.version < 10.0)) { bowser.c = t diff --git a/bowser.min.js b/bowser.min.js index dcec38b..2ce81b4 100644 --- a/bowser.min.js +++ b/bowser.min.js @@ -3,4 +3,4 @@ * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2013 */ -!function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"?define(t):this[e]=t()}("bowser",function(){function y(){return n?{name:"Internet Explorer",msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:c?{name:"Opera",opera:t,version:e.match(v)?e.match(v)[1]:e.match(/opr\/(\d+(\.\d+)?)/i)[1]}:r?{name:"Chrome",webkit:t,chrome:t,version:e.match(/(?:chrome|crios)\/(\d+(\.\d+)?)/i)[1]}:i?{name:"PhantomJS",webkit:t,phantom:t,version:e.match(/phantomjs\/(\d+(\.\d+)+)/i)[1]}:u?{name:"TouchPad",webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:a?{name:"Amazon Silk",webkit:t,android:t,mobile:t,version:e.match(/silk\/(\d+(\.\d+)?)/i)[1]}:s||o?(g={name:s?"iPhone":"iPad",webkit:t,mobile:t,ios:t,iphone:s,ipad:o},v.test(e)&&(g.version=e.match(v)[1]),g):l?{name:"Android",webkit:t,android:t,mobile:t,version:(e.match(v)||e.match(m))[1]}:f?{name:"Safari",webkit:t,safari:t,version:e.match(v)[1]}:p?(g={name:"Gecko",gecko:t,mozilla:t,version:e.match(m)[1]},h&&(g.name="Firefox",g.firefox=t),g):d?{name:"SeaMonkey",seamonkey:t,version:e.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}:{}}var e=navigator.userAgent,t=!0,n=/(msie|trident)/i.test(e),r=/chrome|crios/i.test(e),i=/phantom/i.test(e),s=/iphone/i.test(e),o=/ipad/i.test(e),u=/touchpad/i.test(e),a=/silk/i.test(e),f=/safari/i.test(e)&&!r&&!i&&!a,l=/android/i.test(e),c=/opera/i.test(e)||/opr/i.test(e),h=/firefox/i.test(e),p=/gecko\//i.test(e),d=/seamonkey\//i.test(e),v=/version\/(\d+(\.\d+)?)/i,m=/firefox\/(\d+(\.\d+)?)/i,g,b=y();return b.msie&&b.version>=8||b.chrome&&b.version>=10||b.firefox&&b.version>=4||b.safari&&b.version>=5||b.opera&&b.version>=10?b.a=t:b.msie&&b.version<8||b.chrome&&b.version<10||b.firefox&&b.version<4||b.safari&&b.version<5||b.opera&&b.version<10?b.c=t:b.x=t,b}) \ No newline at end of file +!function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"?define(t):this[e]=t()}("bowser",function(){function b(){return n?{name:"Internet Explorer",msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:c?{name:"Opera",opera:t,version:e.match(v)?e.match(v)[1]:e.match(/opr\/(\d+(\.\d+)?)/i)[1]}:r?{name:"Chrome",webkit:t,chrome:t,version:e.match(/(?:chrome|crios)\/(\d+(\.\d+)?)/i)[1],ipad:o,iphone:s,ios:!!e.match(/crios/i),mobile:g}:i?{name:"PhantomJS",webkit:t,phantom:t,version:e.match(/phantomjs\/(\d+(\.\d+)+)/i)[1]}:u?{name:"TouchPad",webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:a?{name:"Amazon Silk",webkit:t,android:t,mobile:t,version:e.match(/silk\/(\d+(\.\d+)?)/i)[1]}:s||o?(y={name:s?"iPhone":"iPad",webkit:t,mobile:s,ios:t,iphone:s,ipad:o},v.test(e)&&(y.version=e.match(v)[1]),y):l?{name:"Android",webkit:t,android:t,mobile:t,version:(e.match(v)||e.match(m))[1]}:f?{name:"Safari",webkit:t,safari:t,version:e.match(v)[1]}:p?(y={name:"Gecko",gecko:t,mozilla:t,version:e.match(m)[1]},h&&(y.name="Firefox",y.firefox=t),y):d?{name:"SeaMonkey",seamonkey:t,version:e.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}:{}}var e=navigator.userAgent,t=!0,n=/(msie|trident)/i.test(e),r=/chrome|crios/i.test(e),i=/phantom/i.test(e),s=/iphone/i.test(e),o=/ipad/i.test(e),u=/touchpad/i.test(e),a=/silk/i.test(e),f=/safari/i.test(e)&&!r&&!i&&!a,l=/android/i.test(e),c=/opera/i.test(e)||/opr/i.test(e),h=/firefox/i.test(e),p=/gecko\//i.test(e),d=/seamonkey\//i.test(e),v=/version\/(\d+(\.\d+)?)/i,m=/firefox\/(\d+(\.\d+)?)/i,g=/mobile/i.test(e),y,w=b();return w.msie&&w.version>=9||w.chrome&&w.version>=20||w.firefox&&w.version>=10||w.safari&&w.version>=5||w.opera&&w.version>=10?w.a=t:w.msie&&w.version<9||w.chrome&&w.version<20||w.firefox&&w.version<10||w.safari&&w.version<5||w.opera&&w.version<10?w.c=t:w.x=t,w}) \ No newline at end of file