Comparing version 0.0.9 to 0.1.0
@@ -19,3 +19,3 @@ /*! | ||
* 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" | ||
@@ -35,3 +35,5 @@ */ | ||
, gecko = /gecko\//i.test(ua) | ||
, seamonkey = /seamonkey\//i.test(ua) | ||
, webkitVersion = /version\/(\d+(\.\d+)?)/i | ||
, o | ||
@@ -49,16 +51,16 @@ function detect() { | ||
} | ||
if (iphone) return { | ||
webkit: t | ||
, iphone: t | ||
, mobile: t | ||
, ios: t | ||
, version: ua.match(webkitVersion)[1] | ||
if (iphone || ipad) { | ||
o = { | ||
webkit: t | ||
, mobile: t | ||
, ios: t | ||
, iphone: iphone | ||
, ipad: ipad | ||
} | ||
// WTF: version is not part of user agent in web apps | ||
if (webkitVersion.test(ua)) { | ||
o.version = ua.match(webkitVersion)[1] | ||
} | ||
return o | ||
} | ||
if (ipad) return { | ||
webkit: t | ||
, ipad: t | ||
, mobile: t | ||
, ios: t | ||
, version: ua.match(webkitVersion)[1] | ||
} | ||
if (android) return { | ||
@@ -80,3 +82,3 @@ webkit: t | ||
if (gecko) { | ||
var o = { | ||
o = { | ||
gecko: t | ||
@@ -89,3 +91,6 @@ , mozilla: t | ||
} | ||
if (seamonkey) return { | ||
seamonkey: t | ||
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1] | ||
} | ||
} | ||
@@ -92,0 +97,0 @@ |
@@ -6,2 +6,2 @@ /*! | ||
*/ | ||
!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}) | ||
!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function o(){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||g)return n={webkit:b,mobile:b,ios:b,iphone:f,ipad:g},m.test(a)&&(n.version=a.match(m)[1]),n;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)return n={gecko:b,mozilla:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]},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,n,p=o();return p.msie&&p.version>=6||p.chrome&&p.version>=10||p.firefox&&p.version>=4||p.safari&&p.version>=5||p.opera&&p.version>=10?p.a=b:p.msie&&p.version<6||p.chrome&&p.version<10||p.firefox&&p.version<4||p.safari&&p.version<5||p.opera&&p.version<10?p.c=b:p.x=b,p}) |
@@ -24,3 +24,4 @@ require('smoosh').config({ | ||
, "laxbreak": true | ||
, "laxcomma": true | ||
} | ||
}).run().build().analyze() |
@@ -5,3 +5,3 @@ { | ||
, "keywords": ["ender", "browser", "sniff", "detection"] | ||
, "version": "0.0.9" | ||
, "version": "0.1.0" | ||
, "homepage": "https://github.com/ded/bowser" | ||
@@ -8,0 +8,0 @@ , "author": "Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)" |
@@ -14,3 +14,3 @@ !function (name, definition) { | ||
* 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" | ||
@@ -30,3 +30,5 @@ */ | ||
, gecko = /gecko\//i.test(ua) | ||
, seamonkey = /seamonkey\//i.test(ua) | ||
, webkitVersion = /version\/(\d+(\.\d+)?)/i | ||
, o | ||
@@ -44,16 +46,16 @@ function detect() { | ||
} | ||
if (iphone) return { | ||
webkit: t | ||
, iphone: t | ||
, mobile: t | ||
, ios: t | ||
, version: ua.match(webkitVersion)[1] | ||
if (iphone || ipad) { | ||
o = { | ||
webkit: t | ||
, mobile: t | ||
, ios: t | ||
, iphone: iphone | ||
, ipad: ipad | ||
} | ||
// WTF: version is not part of user agent in web apps | ||
if (webkitVersion.test(ua)) { | ||
o.version = ua.match(webkitVersion)[1] | ||
} | ||
return o | ||
} | ||
if (ipad) return { | ||
webkit: t | ||
, ipad: t | ||
, mobile: t | ||
, ios: t | ||
, version: ua.match(webkitVersion)[1] | ||
} | ||
if (android) return { | ||
@@ -75,3 +77,3 @@ webkit: t | ||
if (gecko) { | ||
var o = { | ||
o = { | ||
gecko: t | ||
@@ -84,3 +86,6 @@ , mozilla: t | ||
} | ||
if (seamonkey) return { | ||
seamonkey: t | ||
, version: ua.match(/seamonkey\/(\d+(\.\d+)?)/i)[1] | ||
} | ||
} | ||
@@ -87,0 +92,0 @@ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11393
243
0