Comparing version 0.0.1 to 0.0.2
@@ -23,6 +23,12 @@ /*! | ||
firefox = /firefox/i.test(ua), | ||
gecko = /gecko\//i.test(ua); | ||
gecko = /gecko\//i.test(ua), | ||
info; | ||
function bowser() { | ||
info = info ? info : detect(); | ||
return info; | ||
} | ||
function detect() { | ||
if (ie) { | ||
@@ -68,5 +74,5 @@ return { | ||
typeof module !== 'undefined' && module.exports ? | ||
(module.exports.browser = bowser) : | ||
(module.exports.browser = bowser()) : | ||
(context.bowser = bowser); | ||
}(this); |
@@ -7,2 +7,2 @@ /*! | ||
*/ | ||
!function(a){function i(){if(c)return{msie:1,version:b.match(/msie ([\d\.]+);/i)[1]};if(d)return{webkit:1,chrome:1,version:b.match(/chrome\/([\d\.]+)/i)[1]};if(e)return{webkit:1,safari:1,version:b.match(/version\/([\d\.]+)/i)[1]};if(f)return{opera:1,version:b.match(/version\/([\d\.]+)/i)[1]};if(h){var a={gecko:1,version:b.match(/firefox\/([\d\.]+)/i)[1]};g&&(a.firefox=1);return a}}var b=navigator.userAgent,c=/msie/i.test(b),d=/chrome/i.test(b),e=/safari/i.test(b)&&!d,f=/opera/i.test(b),g=/firefox/i.test(b),h=/gecko\//i.test(b);typeof module!="undefined"&&module.exports?module.exports.browser=i:a.bowser=i}(this) | ||
!function(a){function k(){if(c)return{msie:1,version:b.match(/msie ([\d\.]+);/i)[1]};if(d)return{webkit:1,chrome:1,version:b.match(/chrome\/([\d\.]+)/i)[1]};if(e)return{webkit:1,safari:1,version:b.match(/version\/([\d\.]+)/i)[1]};if(f)return{opera:1,version:b.match(/version\/([\d\.]+)/i)[1]};if(h){var a={gecko:1,version:b.match(/firefox\/([\d\.]+)/i)[1]};g&&(a.firefox=1);return a}}function j(){i=i?i:k();return i}var b=navigator.userAgent,c=/msie/i.test(b),d=/chrome/i.test(b),e=/safari/i.test(b)&&!d,f=/opera/i.test(b),g=/firefox/i.test(b),h=/gecko\//i.test(b),i;typeof module!="undefined"&&module.exports?module.exports.browser=j():a.bowser=j}(this) |
{ | ||
"name": "bowser", | ||
"description": "a browser detector", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/ded/bowser", | ||
@@ -6,0 +6,0 @@ "author": "Dustin Diaz <@ded>", |
Bowser | ||
------ | ||
A Browser detector. Because sometimes, there is no other way, and not even good modern browser provide good feature detection mechanisms. | ||
A Browser detector. Because sometimes, there is no other way, and not even good modern browsers always provide good feature detection mechanisms. | ||
Works like this: | ||
So... it works like this: | ||
@@ -7,0 +7,0 @@ if (bowser().msie && bowser().version <= 6) { |
@@ -17,6 +17,12 @@ !function (context) { | ||
firefox = /firefox/i.test(ua), | ||
gecko = /gecko\//i.test(ua); | ||
gecko = /gecko\//i.test(ua), | ||
info; | ||
function bowser() { | ||
info = info ? info : detect(); | ||
return info; | ||
} | ||
function detect() { | ||
if (ie) { | ||
@@ -62,5 +68,5 @@ return { | ||
typeof module !== 'undefined' && module.exports ? | ||
(module.exports.browser = bowser) : | ||
(module.exports.browser = bowser()) : | ||
(context.bowser = bowser); | ||
}(this); |
6456
164