From 325df23ddc00aca11c031d022b23858d6b80befb Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 26 Jan 2014 02:14:50 -0800 Subject: [PATCH 01/14] add support amazon silk support for kindle devices --- bowser.js | 10 ++++++++++ bowser.min.js | 2 +- src/bowser.js | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/bowser.js b/bowser.js index 52a0e02..56c55dd 100644 --- a/bowser.js +++ b/bowser.js @@ -22,6 +22,7 @@ * 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" * PhantomJS: "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.5.0 Safari/534.34" + * Amazon Silk: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.22.153_10033210) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" */ var ua = navigator.userAgent @@ -33,6 +34,7 @@ , iphone = /iphone/i.test(ua) , ipad = /ipad/i.test(ua) , touchpad = /touchpad/i.test(ua) + , silk = /silk/i.test(ua) , android = /android/i.test(ua) , opera = /opera/i.test(ua) || /opr/i.test(ua) , firefox = /firefox/i.test(ua) @@ -72,6 +74,14 @@ , touchpad: t , version : ua.match(/touchpad\/(\d+(\.\d+)?)/i)[1] } + + if (silk) return { + name: 'Amazon Silk' + , webkit: t + , android: t + , mobile: t + , version : ua.match(/silk\/(\d+(\.\d+)?)/i)[1] + } if (iphone || ipad) { o = { name : iphone ? 'iPhone' : 'iPad' diff --git a/bowser.min.js b/bowser.min.js index 39277ba..52ddadb 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 define=="function"?define(t):typeof module!="undefined"&&module.exports?module.exports.browser=t():this[e]=t()}("bowser",function(){function g(){return n?{name:"Internet Explorer",msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:l?{name:"Opera",opera:t,version:e.match(d)?e.match(d)[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]}:a?{name:"TouchPad",webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:o||u?(m={name:o?"iPhone":"iPad",webkit:t,mobile:t,ios:t,iphone:o,ipad:u},d.test(e)&&(m.version=e.match(d)[1]),m):f?{name:"Android",webkit:t,android:t,mobile:t,version:(e.match(d)||e.match(v))[1]}:s?{name:"Safari",webkit:t,safari:t,version:e.match(d)[1]}:h?(m={name:"Gecko",gecko:t,mozilla:t,version:e.match(v)[1]},c&&(m.name="Firefox",m.firefox=t),m):p?{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=/safari/i.test(e)&&!r&&!i,o=/iphone/i.test(e),u=/ipad/i.test(e),a=/touchpad/i.test(e),f=/android/i.test(e),l=/opera/i.test(e)||/opr/i.test(e),c=/firefox/i.test(e),h=/gecko\//i.test(e),p=/seamonkey\//i.test(e),d=/version\/(\d+(\.\d+)?)/i,v=/firefox\/(\d+(\.\d+)?)/i,m,y=g();return y.msie&&y.version>=8||y.chrome&&y.version>=10||y.firefox&&y.version>=4||y.safari&&y.version>=5||y.opera&&y.version>=10?y.a=t:y.msie&&y.version<8||y.chrome&&y.version<10||y.firefox&&y.version<4||y.safari&&y.version<5||y.opera&&y.version<10?y.c=t:y.x=t,y}) \ No newline at end of file +!function(e,t){typeof define=="function"?define(t):typeof module!="undefined"&&module.exports?module.exports.browser=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]}: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]}:o||u?(g={name:o?"iPhone":"iPad",webkit:t,mobile:t,ios:t,iphone:o,ipad:u},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]}:s?{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=/safari/i.test(e)&&!r&&!i,o=/iphone/i.test(e),u=/ipad/i.test(e),a=/touchpad/i.test(e),f=/silk/i.test(e),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 diff --git a/src/bowser.js b/src/bowser.js index 86a2d5c..dfda4b4 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -16,6 +16,7 @@ * 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" * PhantomJS: "Mozilla/5.0 (Macintosh; Intel Mac OS X) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.5.0 Safari/534.34" + * Amazon Silk: "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.22.153_10033210) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true" */ var ua = navigator.userAgent @@ -27,6 +28,7 @@ , iphone = /iphone/i.test(ua) , ipad = /ipad/i.test(ua) , touchpad = /touchpad/i.test(ua) + , silk = /silk/i.test(ua) , android = /android/i.test(ua) , opera = /opera/i.test(ua) || /opr/i.test(ua) , firefox = /firefox/i.test(ua) @@ -66,6 +68,14 @@ , touchpad: t , version : ua.match(/touchpad\/(\d+(\.\d+)?)/i)[1] } + + if (silk) return { + name: 'Amazon Silk' + , webkit: t + , android: t + , mobile: t + , version : ua.match(/silk\/(\d+(\.\d+)?)/i)[1] + } if (iphone || ipad) { o = { name : iphone ? 'iPhone' : 'iPad' From 0ff5acd06f865553c903a68925c7fee86f5db01f Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sun, 26 Jan 2014 14:43:17 -0800 Subject: [PATCH 02/14] add building instructions --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ba6e427..93cb076 100644 --- a/README.md +++ b/README.md @@ -60,4 +60,12 @@ else if (bowser.c) { } else { // unsupported (bowser.x) -} \ No newline at end of file +} + +Building +--------- + +If you'd like to contribute a change to bowser, modify the files in src/, then run the following (you'll need node + npm installed): + + $ npm install + $ make From efe1c6719a75b05e5372496d9fe8670125364001 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Mon, 27 Jan 2014 14:01:01 -0800 Subject: [PATCH 03/14] closes #16 - move commonjs to first check --- bowser.js | 4 ++-- bowser.min.js | 2 +- src/bowser.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bowser.js b/bowser.js index 52a0e02..ea3991b 100644 --- a/bowser.js +++ b/bowser.js @@ -5,8 +5,8 @@ */ !function (name, definition) { - if (typeof define == 'function') define(definition) - else if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition() + if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition() + else if (typeof define == 'function') define(definition) else this[name] = definition() }('bowser', function () { /** diff --git a/bowser.min.js b/bowser.min.js index 39277ba..d7906c7 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 define=="function"?define(t):typeof module!="undefined"&&module.exports?module.exports.browser=t():this[e]=t()}("bowser",function(){function g(){return n?{name:"Internet Explorer",msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:l?{name:"Opera",opera:t,version:e.match(d)?e.match(d)[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]}:a?{name:"TouchPad",webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:o||u?(m={name:o?"iPhone":"iPad",webkit:t,mobile:t,ios:t,iphone:o,ipad:u},d.test(e)&&(m.version=e.match(d)[1]),m):f?{name:"Android",webkit:t,android:t,mobile:t,version:(e.match(d)||e.match(v))[1]}:s?{name:"Safari",webkit:t,safari:t,version:e.match(d)[1]}:h?(m={name:"Gecko",gecko:t,mozilla:t,version:e.match(v)[1]},c&&(m.name="Firefox",m.firefox=t),m):p?{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=/safari/i.test(e)&&!r&&!i,o=/iphone/i.test(e),u=/ipad/i.test(e),a=/touchpad/i.test(e),f=/android/i.test(e),l=/opera/i.test(e)||/opr/i.test(e),c=/firefox/i.test(e),h=/gecko\//i.test(e),p=/seamonkey\//i.test(e),d=/version\/(\d+(\.\d+)?)/i,v=/firefox\/(\d+(\.\d+)?)/i,m,y=g();return y.msie&&y.version>=8||y.chrome&&y.version>=10||y.firefox&&y.version>=4||y.safari&&y.version>=5||y.opera&&y.version>=10?y.a=t:y.msie&&y.version<8||y.chrome&&y.version<10||y.firefox&&y.version<4||y.safari&&y.version<5||y.opera&&y.version<10?y.c=t:y.x=t,y}) \ 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 g(){return n?{name:"Internet Explorer",msie:t,version:e.match(/(msie |rv:)(\d+(\.\d+)?)/i)[2]}:l?{name:"Opera",opera:t,version:e.match(d)?e.match(d)[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]}:a?{name:"TouchPad",webkit:t,touchpad:t,version:e.match(/touchpad\/(\d+(\.\d+)?)/i)[1]}:o||u?(m={name:o?"iPhone":"iPad",webkit:t,mobile:t,ios:t,iphone:o,ipad:u},d.test(e)&&(m.version=e.match(d)[1]),m):f?{name:"Android",webkit:t,android:t,mobile:t,version:(e.match(d)||e.match(v))[1]}:s?{name:"Safari",webkit:t,safari:t,version:e.match(d)[1]}:h?(m={name:"Gecko",gecko:t,mozilla:t,version:e.match(v)[1]},c&&(m.name="Firefox",m.firefox=t),m):p?{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=/safari/i.test(e)&&!r&&!i,o=/iphone/i.test(e),u=/ipad/i.test(e),a=/touchpad/i.test(e),f=/android/i.test(e),l=/opera/i.test(e)||/opr/i.test(e),c=/firefox/i.test(e),h=/gecko\//i.test(e),p=/seamonkey\//i.test(e),d=/version\/(\d+(\.\d+)?)/i,v=/firefox\/(\d+(\.\d+)?)/i,m,y=g();return y.msie&&y.version>=8||y.chrome&&y.version>=10||y.firefox&&y.version>=4||y.safari&&y.version>=5||y.opera&&y.version>=10?y.a=t:y.msie&&y.version<8||y.chrome&&y.version<10||y.firefox&&y.version<4||y.safari&&y.version<5||y.opera&&y.version<10?y.c=t:y.x=t,y}) \ No newline at end of file diff --git a/src/bowser.js b/src/bowser.js index 86a2d5c..b5fb2db 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -1,6 +1,6 @@ !function (name, definition) { - if (typeof define == 'function') define(definition) - else if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition() + if (typeof module != 'undefined' && module.exports) module.exports['browser'] = definition() + else if (typeof define == 'function') define(definition) else this[name] = definition() }('bowser', function () { /** From cffc0c8a00be5c3b6d678610351b709d3ba69e9a Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Mon, 27 Jan 2014 14:01:27 -0800 Subject: [PATCH 04/14] 0.3.5 --- package.json | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index cb4ed31..2868fb2 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,21 @@ { - "name": "bowser" - , "description": "a browser detector" - , "keywords": ["ender", "browser", "sniff", "detection"] - , "version": "0.3.4" - , "homepage": "https://github.com/ded/bowser" - , "author": "Dustin Diaz (http://dustindiaz.com)" - , "main": "./bowser.js" - , "repository": { - "type": "git" - , "url": "https://github.com/ded/bowser.git" - } - , "devDependencies": { - "smoosh": "*" + "name": "bowser", + "description": "a browser detector", + "keywords": [ + "ender", + "browser", + "sniff", + "detection" + ], + "version": "0.3.5", + "homepage": "https://github.com/ded/bowser", + "author": "Dustin Diaz (http://dustindiaz.com)", + "main": "./bowser.js", + "repository": { + "type": "git", + "url": "https://github.com/ded/bowser.git" + }, + "devDependencies": { + "smoosh": "*" } } From 450e3158db840c1310a12acd0ce5876b53fb2398 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Mon, 27 Jan 2014 14:06:34 -0800 Subject: [PATCH 05/14] 0.3.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2868fb2..a012bf0 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "0.3.5", + "version": "0.3.6", "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./bowser.js", From 6f23dc0338876dc98a4e0fb3714e7695e93dc948 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Mon, 27 Jan 2014 14:10:16 -0800 Subject: [PATCH 06/14] closes #35 - making silk not part of safari detection --- bowser.js | 2 +- bowser.min.js | 2 +- src/bowser.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bowser.js b/bowser.js index a0ddc31..12f97fd 100644 --- a/bowser.js +++ b/bowser.js @@ -30,11 +30,11 @@ , ie = /(msie|trident)/i.test(ua) , chrome = /chrome|crios/i.test(ua) , phantom = /phantom/i.test(ua) - , safari = /safari/i.test(ua) && !chrome && !phantom , iphone = /iphone/i.test(ua) , ipad = /ipad/i.test(ua) , touchpad = /touchpad/i.test(ua) , silk = /silk/i.test(ua) + , safari = /safari/i.test(ua) && !chrome && !phantom && !silk , android = /android/i.test(ua) , opera = /opera/i.test(ua) || /opr/i.test(ua) , firefox = /firefox/i.test(ua) diff --git a/bowser.min.js b/bowser.min.js index 6c8fa17..dcec38b 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]}: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]}:o||u?(g={name:o?"iPhone":"iPad",webkit:t,mobile:t,ios:t,iphone:o,ipad:u},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]}:s?{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=/safari/i.test(e)&&!r&&!i,o=/iphone/i.test(e),u=/ipad/i.test(e),a=/touchpad/i.test(e),f=/silk/i.test(e),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 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 diff --git a/src/bowser.js b/src/bowser.js index 82a0754..5b6dde6 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -24,11 +24,11 @@ , ie = /(msie|trident)/i.test(ua) , chrome = /chrome|crios/i.test(ua) , phantom = /phantom/i.test(ua) - , safari = /safari/i.test(ua) && !chrome && !phantom , iphone = /iphone/i.test(ua) , ipad = /ipad/i.test(ua) , touchpad = /touchpad/i.test(ua) , silk = /silk/i.test(ua) + , safari = /safari/i.test(ua) && !chrome && !phantom && !silk , android = /android/i.test(ua) , opera = /opera/i.test(ua) || /opr/i.test(ua) , firefox = /firefox/i.test(ua) From 819b2eccd89b55be3c1e6c8c8f6e782d9573a2df Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Mon, 27 Jan 2014 14:10:37 -0800 Subject: [PATCH 07/14] 0.3.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a012bf0..ea78ba1 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "0.3.6", + "version": "0.3.7", "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./bowser.js", From 8e2b077a4b459d954bcfe08a7874269715f0e9ea Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 29 Jan 2014 00:18:45 -0800 Subject: [PATCH 08/14] fix README formatting --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 93cb076..10bfbfa 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ else if (bowser.c) { else { // unsupported (bowser.x) } +``` Building --------- From 4bba352a16d53524f3bb57e31932d91253f00073 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Wed, 19 Feb 2014 09:07:14 -0800 Subject: [PATCH 09/14] add `ipad` and `mobile` to chrome devices --- src/bowser.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index 5b6dde6..ab299dd 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -36,6 +36,7 @@ , seamonkey = /seamonkey\//i.test(ua) , webkitVersion = /version\/(\d+(\.\d+)?)/i , firefoxVersion = /firefox\/(\d+(\.\d+)?)/i + , mobile = /mobile/i.test(ua) , o function detect() { @@ -55,6 +56,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' @@ -80,7 +85,7 @@ o = { name : iphone ? 'iPhone' : 'iPad' , webkit: t - , mobile: t + , mobile: iphone , ios: t , iphone: iphone , ipad: ipad @@ -129,17 +134,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 From d34499a4d9542a89b8fb0796373604934e437f2f Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Wed, 19 Feb 2014 09:08:16 -0800 Subject: [PATCH 10/14] rebuild --- bowser.js | 19 ++++++++++++------- bowser.min.js | 2 +- 2 files changed, 13 insertions(+), 8 deletions(-) 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 From 3f793853c8e1ff38b127c461228c3aa41f317ac2 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Wed, 19 Feb 2014 09:08:23 -0800 Subject: [PATCH 11/14] 0.3.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea78ba1..b7469a8 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "0.3.7", + "version": "0.3.8", "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./bowser.js", From fe82184bdfb075eb5f3eff8ab85a0340bc4eae39 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Wed, 19 Feb 2014 09:15:20 -0800 Subject: [PATCH 12/14] adds `ipod` to the mix closes #37 --- src/bowser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index ab299dd..b4c9b83 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -13,6 +13,7 @@ * 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" * 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" * 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" @@ -26,6 +27,7 @@ , phantom = /phantom/i.test(ua) , iphone = /iphone/i.test(ua) , ipad = /ipad/i.test(ua) + , ipod = /ipod/i.test(ua) , touchpad = /touchpad/i.test(ua) , silk = /silk/i.test(ua) , safari = /safari/i.test(ua) && !chrome && !phantom && !silk @@ -81,14 +83,15 @@ , mobile: t , version : ua.match(/silk\/(\d+(\.\d+)?)/i)[1] } - if (iphone || ipad) { + if (iphone || ipad || ipod) { o = { - name : iphone ? 'iPhone' : 'iPad' + name : iphone ? 'iPhone' : ipad ? 'iPad' : 'iPod' , webkit: t , mobile: iphone , ios: t , iphone: iphone , ipad: ipad + , ipod: ipod } // WTF: version is not part of user agent in web apps if (webkitVersion.test(ua)) { From 36a94abe1b7e614ca7cf5f7cd85f5cbdc35201c5 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Wed, 19 Feb 2014 09:16:06 -0800 Subject: [PATCH 13/14] rebuild for #37 --- bowser.js | 7 +++++-- bowser.min.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bowser.js b/bowser.js index 1bd0b18..4760640 100644 --- a/bowser.js +++ b/bowser.js @@ -19,6 +19,7 @@ * 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" * 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" * 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" @@ -32,6 +33,7 @@ , phantom = /phantom/i.test(ua) , iphone = /iphone/i.test(ua) , ipad = /ipad/i.test(ua) + , ipod = /ipod/i.test(ua) , touchpad = /touchpad/i.test(ua) , silk = /silk/i.test(ua) , safari = /safari/i.test(ua) && !chrome && !phantom && !silk @@ -87,14 +89,15 @@ , mobile: t , version : ua.match(/silk\/(\d+(\.\d+)?)/i)[1] } - if (iphone || ipad) { + if (iphone || ipad || ipod) { o = { - name : iphone ? 'iPhone' : 'iPad' + name : iphone ? 'iPhone' : ipad ? 'iPad' : 'iPod' , webkit: t , mobile: iphone , ios: t , iphone: iphone , ipad: ipad + , ipod: ipod } // WTF: version is not part of user agent in web apps if (webkitVersion.test(ua)) { diff --git a/bowser.min.js b/bowser.min.js index 2ce81b4..1dc92af 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 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 +!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}) \ No newline at end of file From d782ab54b1a1d972b68d401f5acc3a76a2acba29 Mon Sep 17 00:00:00 2001 From: Dustin Diaz Date: Wed, 19 Feb 2014 09:16:17 -0800 Subject: [PATCH 14/14] 0.3.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b7469a8..0d5b81d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "sniff", "detection" ], - "version": "0.3.8", + "version": "0.3.9", "homepage": "https://github.com/ded/bowser", "author": "Dustin Diaz (http://dustindiaz.com)", "main": "./bowser.js",