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

graded supported getting set correctly. bump package

This commit is contained in:
Dustin Diaz 2011-05-19 10:32:27 -07:00
parent 22be8a6caa
commit 6bb347a994
4 changed files with 31 additions and 14 deletions

View File

@ -1,3 +1,9 @@
/*!
* Bowser - a browser detector
* copyright Dustin Diaz 2011
* https://github.com/ded/bowser
* MIT License
*/
/*! /*!
* Bowser - a browser detector * Bowser - a browser detector
* copyright Dustin Diaz 2011 * copyright Dustin Diaz 2011
@ -27,33 +33,33 @@
if (ie) { if (ie) {
return { return {
msie: 1, msie: 1,
version: ua.match(/msie ([\d\.]+);/i)[1] version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
}; };
} }
if (chrome) { if (chrome) {
return { return {
webkit: 1, webkit: 1,
chrome: 1, chrome: 1,
version: ua.match(/chrome\/([\d\.]+)/i)[1] version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}; };
} }
if (safari) { if (safari) {
return { return {
webkit: 1, webkit: 1,
safari: 1, safari: 1,
version: ua.match(/version\/([\d\.]+)/i)[1] version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
}; };
} }
if (opera) { if (opera) {
return { return {
opera: 1, opera: 1,
version: ua.match(/version\/([\d\.]+)/i)[1] version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
}; };
} }
if (gecko) { if (gecko) {
var o = { var o = {
gecko: 1, gecko: 1,
version: ua.match(/firefox\/([\d\.]+)/i)[1] version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
}; };
if (firefox) { if (firefox) {
o.firefox = 1; o.firefox = 1;
@ -89,4 +95,4 @@
(module.exports.browser = bowser) : (module.exports.browser = bowser) :
(context.bowser = bowser); (context.bowser = bowser);
}(this); }(this);

7
bowser.min.js vendored
View File

@ -1,7 +1,12 @@
/*! /*!
* Bowser - a browser detector
* copyright Dustin Diaz 2011
* https://github.com/ded/bowser
* MIT License
*//*!
* Bowser - a browser detector * Bowser - a browser detector
* copyright Dustin Diaz 2011 * copyright Dustin Diaz 2011
* https://github.com/ded/bowser * https://github.com/ded/bowser
* MIT License * MIT License
*/ */
!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),j=i();j.msie&&j.version>=6||j.chrome&&j.version>=8||j.firefox&&j.version>=3.6||j.safari&&j.version>=5||j.opera&&j.version>=9.5?j.a=!0:j.msie&&j.version<6||j.chrome&&j.version<8||j.firefox&&j.version<3.6||j.safari&&j.version<5||j.opera&&j.version<9.5?j.c=!0:j.x=!0,typeof module!="undefined"&&module.exports?module.exports.browser=j:a.bowser=j}(this) !function(a){function i(){if(c)return{msie:1,version:b.match(/msie (\d+(\.\d+)?);/i)[1]};if(d)return{webkit:1,chrome:1,version:b.match(/chrome\/(\d+(\.\d+)?)/i)[1]};if(e)return{webkit:1,safari:1,version:b.match(/version\/(\d+(\.\d+)?)/i)[1]};if(f)return{opera:1,version:b.match(/version\/(\d+(\.\d+)?)/i)[1]};if(h){var a={gecko:1,version:b.match(/firefox\/(\d+(\.\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),j=i();j.msie&&j.version>=6||j.chrome&&j.version>=8||j.firefox&&j.version>=3.6||j.safari&&j.version>=5||j.opera&&j.version>=9.5?j.a=!0:j.msie&&j.version<6||j.chrome&&j.version<8||j.firefox&&j.version<3.6||j.safari&&j.version<5||j.opera&&j.version<9.5?j.c=!0:j.x=!0,typeof module!="undefined"&&module.exports?module.exports.browser=j:a.bowser=j}(this)

View File

@ -2,7 +2,7 @@
"name": "bowser", "name": "bowser",
"description": "a browser detector", "description": "a browser detector",
"keywords": ["ender", "browser", "sniff", "detection"], "keywords": ["ender", "browser", "sniff", "detection"],
"version": "0.0.4", "version": "0.0.5",
"homepage": "https://github.com/ded/bowser", "homepage": "https://github.com/ded/bowser",
"author": "Dustin Diaz <@ded>", "author": "Dustin Diaz <@ded>",
"repository": { "repository": {

View File

@ -1,3 +1,9 @@
/*!
* Bowser - a browser detector
* copyright Dustin Diaz 2011
* https://github.com/ded/bowser
* MIT License
*/
!function (context) { !function (context) {
/** /**
* navigator.userAgent => * navigator.userAgent =>
@ -21,33 +27,33 @@
if (ie) { if (ie) {
return { return {
msie: 1, msie: 1,
version: ua.match(/msie ([\d\.]+);/i)[1] version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
}; };
} }
if (chrome) { if (chrome) {
return { return {
webkit: 1, webkit: 1,
chrome: 1, chrome: 1,
version: ua.match(/chrome\/([\d\.]+)/i)[1] version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
}; };
} }
if (safari) { if (safari) {
return { return {
webkit: 1, webkit: 1,
safari: 1, safari: 1,
version: ua.match(/version\/([\d\.]+)/i)[1] version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
}; };
} }
if (opera) { if (opera) {
return { return {
opera: 1, opera: 1,
version: ua.match(/version\/([\d\.]+)/i)[1] version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
}; };
} }
if (gecko) { if (gecko) {
var o = { var o = {
gecko: 1, gecko: 1,
version: ua.match(/firefox\/([\d\.]+)/i)[1] version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
}; };
if (firefox) { if (firefox) {
o.firefox = 1; o.firefox = 1;
@ -83,4 +89,4 @@
(module.exports.browser = bowser) : (module.exports.browser = bowser) :
(context.bowser = bowser); (context.bowser = bowser);
}(this); }(this);