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

rebuild for #37

This commit is contained in:
Dustin Diaz 2014-02-19 09:16:06 -08:00
parent fe82184bdf
commit 36a94abe1b
2 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,7 @@
* Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0" * Firefox: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0"
* iPhone: "Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5" * iPhone: "Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5"
* iPad: "Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5", * iPad: "Mozilla/5.0 (iPad; U; CPU OS 4_3_2 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8H7 Safari/6533.18.5",
* iPod: "Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5"
* Android: "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; T-Mobile G2 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1" * Android: "Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; T-Mobile G2 Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
* Touchpad: "Mozilla/5.0 (hp-tabled;Linux;hpwOS/3.0.5; U; en-US)) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.83 Safari/534.6 TouchPad/1.0" * Touchpad: "Mozilla/5.0 (hp-tabled;Linux;hpwOS/3.0.5; U; en-US)) AppleWebKit/534.6 (KHTML, like Gecko) wOSBrowser/234.83 Safari/534.6 TouchPad/1.0"
* PhantomJS: "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.5.0 Safari/534.34" * PhantomJS: "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.5.0 Safari/534.34"
@ -32,6 +33,7 @@
, phantom = /phantom/i.test(ua) , phantom = /phantom/i.test(ua)
, iphone = /iphone/i.test(ua) , iphone = /iphone/i.test(ua)
, ipad = /ipad/i.test(ua) , ipad = /ipad/i.test(ua)
, ipod = /ipod/i.test(ua)
, touchpad = /touchpad/i.test(ua) , touchpad = /touchpad/i.test(ua)
, silk = /silk/i.test(ua) , silk = /silk/i.test(ua)
, safari = /safari/i.test(ua) && !chrome && !phantom && !silk , safari = /safari/i.test(ua) && !chrome && !phantom && !silk
@ -87,14 +89,15 @@
, mobile: t , mobile: t
, version : ua.match(/silk\/(\d+(\.\d+)?)/i)[1] , version : ua.match(/silk\/(\d+(\.\d+)?)/i)[1]
} }
if (iphone || ipad) { if (iphone || ipad || ipod) {
o = { o = {
name : iphone ? 'iPhone' : 'iPad' name : iphone ? 'iPhone' : ipad ? 'iPad' : 'iPod'
, webkit: t , webkit: t
, mobile: iphone , mobile: iphone
, ios: t , ios: t
, iphone: iphone , iphone: iphone
, ipad: ipad , ipad: ipad
, ipod: ipod
} }
// WTF: version is not part of user agent in web apps // WTF: version is not part of user agent in web apps
if (webkitVersion.test(ua)) { if (webkitVersion.test(ua)) {

2
bowser.min.js vendored
View File

@ -3,4 +3,4 @@
* https://github.com/ded/bowser * https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2013 * 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 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}) !function(e,t){typeof module!="undefined"&&module.exports?module.exports.browser=t():typeof define=="function"?define(t):this[e]=t()}("bowser",function(){function w(){return n?{name:"Internet Explorer",msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:h?{name:"Opera",opera:t,version:e.match(m)?e.match(m)[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:y}:i?{name:"PhantomJS",webkit:t,phantom:t,version:e.match(/phantomjs\/(\d+(\.\d+)+)/i)[1]}:a?{name:"TouchPad",webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:f?{name:"Amazon Silk",webkit:t,android:t,mobile:t,version:e.match(/silk\/(\d+(\.\d+)?)/i)[1]}:s||o||u?(b={name:s?"iPhone":o?"iPad":"iPod",webkit:t,mobile:s,ios:t,iphone:s,ipad:o,ipod:u},m.test(e)&&(b.version=e.match(m)[1]),b):c?{name:"Android",webkit:t,android:t,mobile:t,version:(e.match(m)||e.match(g))[1]}:l?{name:"Safari",webkit:t,safari:t,version:e.match(m)[1]}:d?(b={name:"Gecko",gecko:t,mozilla:t,version:e.match(g)[1]},p&&(b.name="Firefox",b.firefox=t),b):v?{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=/ipod/i.test(e),a=/touchpad/i.test(e),f=/silk/i.test(e),l=/safari/i.test(e)&&!r&&!i&&!f,c=/android/i.test(e),h=/opera/i.test(e)||/opr/i.test(e),p=/firefox/i.test(e),d=/gecko\//i.test(e),v=/seamonkey\//i.test(e),m=/version\/(\d+(\.\d+)?)/i,g=/firefox\/(\d+(\.\d+)?)/i,y=/mobile/i.test(e),b,E=w();return E.msie&&E.version>=9||E.chrome&&E.version>=20||E.firefox&&E.version>=10||E.safari&&E.version>=5||E.opera&&E.version>=10?E.a=t:E.msie&&E.version<9||E.chrome&&E.version<20||E.firefox&&E.version<10||E.safari&&E.version<5||E.opera&&E.version<10?E.c=t:E.x=t,E})