From 2be132a7a5c9fc459c554ec8e9aecde654fd9f63 Mon Sep 17 00:00:00 2001 From: plukevdh Date: Wed, 16 Nov 2011 22:18:22 -0500 Subject: [PATCH 1/2] add seamonkey --- src/bowser.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index 0178a28..ad9b13f 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -11,7 +11,7 @@ * IE: "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)" * 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", + * 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", * 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" */ @@ -26,6 +26,7 @@ , opera = /opera/i.test(ua) , firefox = /firefox/i.test(ua) , gecko = /gecko\//i.test(ua) + , seamonkey = /seamonkey\//i.test(ua) , webkitVersion = /version\/(\d+(\.\d+)?)/i function detect() { @@ -77,7 +78,10 @@ if (firefox) o.firefox = t return o } - + if (seamonkey) return { + seamonkey: t + , version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1] + } } var bowser = detect() From de010bbdd0cc999d55a96dbe77661030014dea37 Mon Sep 17 00:00:00 2001 From: plukevdh Date: Wed, 16 Nov 2011 22:39:43 -0500 Subject: [PATCH 2/2] sea monkey built --- bowser.js | 8 ++++++-- bowser.min.js | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bowser.js b/bowser.js index 2a8c6fe..78e11c3 100644 --- a/bowser.js +++ b/bowser.js @@ -16,7 +16,7 @@ * IE: "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)" * 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", + * 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", * 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" */ @@ -31,6 +31,7 @@ , opera = /opera/i.test(ua) , firefox = /firefox/i.test(ua) , gecko = /gecko\//i.test(ua) + , seamonkey = /seamonkey\//i.test(ua) , webkitVersion = /version\/(\d+(\.\d+)?)/i function detect() { @@ -82,7 +83,10 @@ if (firefox) o.firefox = t return o } - + if (seamonkey) return { + seamonkey: t + , version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1] + } } var bowser = detect() diff --git a/bowser.min.js b/bowser.min.js index 5882e42..9bb3d5f 100644 --- a/bowser.min.js +++ b/bowser.min.js @@ -3,4 +3,4 @@ * https://github.com/ded/bowser * MIT License | (c) Dustin Diaz 2011 */ -!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function m(){if(c)return{msie:b,version:a.match(/msie (\d+(\.\d+)?);/i)[1]};if(d)return{webkit:b,chrome:b,version:a.match(/chrome\/(\d+(\.\d+)?)/i)[1]};if(f)return{webkit:b,iphone:b,mobile:b,ios:b,version:a.match(l)[1]};if(g)return{webkit:b,ipad:b,mobile:b,ios:b,version:a.match(l)[1]};if(h)return{webkit:b,android:b,mobile:b,version:a.match(l)[1]};if(e)return{webkit:b,safari:b,version:a.match(l)[1]};if(i)return{opera:b,version:a.match(l)[1]};if(k){var m={gecko:b,mozilla:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]};j&&(m.firefox=b);return m}}var a=navigator.userAgent,b=!0,c=/msie/i.test(a),d=/chrome/i.test(a),e=/safari/i.test(a)&&!d,f=/iphone/i.test(a),g=/ipad/i.test(a),h=/android/i.test(a),i=/opera/i.test(a),j=/firefox/i.test(a),k=/gecko\//i.test(a),l=/version\/(\d+(\.\d+)?)/i,n=m();n.msie&&n.version>=6||n.chrome&&n.version>=10||n.firefox&&n.version>=4||n.safari&&n.version>=5||n.opera&&n.version>=10?n.a=b:n.msie&&n.version<6||n.chrome&&n.version<10||n.firefox&&n.version<4||n.safari&&n.version<5||n.opera&&n.version<10?n.c=b:n.x=b;return n}) \ No newline at end of file +!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function n(){if(c)return{msie:b,version:a.match(/msie (\d+(\.\d+)?);/i)[1]};if(d)return{webkit:b,chrome:b,version:a.match(/chrome\/(\d+(\.\d+)?)/i)[1]};if(f)return{webkit:b,iphone:b,mobile:b,ios:b,version:a.match(m)[1]};if(g)return{webkit:b,ipad:b,mobile:b,ios:b,version:a.match(m)[1]};if(h)return{webkit:b,android:b,mobile:b,version:a.match(m)[1]};if(e)return{webkit:b,safari:b,version:a.match(m)[1]};if(i)return{opera:b,version:a.match(m)[1]};if(k){var n={gecko:b,mozilla:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]};return j&&(n.firefox=b),n}if(l)return{seamonkey:b,version:a.match(/seamonkey\/(\d+(\.\d+)?)/i)[1]}}var a=navigator.userAgent,b=!0,c=/msie/i.test(a),d=/chrome/i.test(a),e=/safari/i.test(a)&&!d,f=/iphone/i.test(a),g=/ipad/i.test(a),h=/android/i.test(a),i=/opera/i.test(a),j=/firefox/i.test(a),k=/gecko\//i.test(a),l=/seamonkey\//i.test(a),m=/version\/(\d+(\.\d+)?)/i,o=n();return o.msie&&o.version>=6||o.chrome&&o.version>=10||o.firefox&&o.version>=4||o.safari&&o.version>=5||o.opera&&o.version>=10?o.a=b:o.msie&&o.version<6||o.chrome&&o.version<10||o.firefox&&o.version<4||o.safari&&o.version<5||o.opera&&o.version<10?o.c=b:o.x=b,o}) \ No newline at end of file