mirror of
https://github.com/lancedikson/bowser
synced 2025-06-13 13:03:52 +00:00
Updated the source to match the last commit with the corrected graded browser support and changed all the 1 with true for evoiding coercion wrapping it in one variable as suggested....
!function (context,t) { //bla bla }(this,true);
This commit is contained in:
parent
45af8a7231
commit
734e526e73
@ -1,4 +1,16 @@
|
|||||||
!function (context) {
|
/*!
|
||||||
|
* Bowser - a browser detector
|
||||||
|
* copyright Dustin Diaz 2011
|
||||||
|
* https://github.com/ded/bowser
|
||||||
|
* MIT License
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* Bowser - a browser detector
|
||||||
|
* copyright Dustin Diaz 2011
|
||||||
|
* https://github.com/ded/bowser
|
||||||
|
* MIT License
|
||||||
|
*/
|
||||||
|
!function (context,t) {
|
||||||
/**
|
/**
|
||||||
* navigator.userAgent =>
|
* navigator.userAgent =>
|
||||||
* Chrome: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24"
|
* Chrome: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57 Safari/534.24"
|
||||||
@ -20,37 +32,37 @@
|
|||||||
|
|
||||||
if (ie) {
|
if (ie) {
|
||||||
return {
|
return {
|
||||||
msie: 1,
|
msie: t,
|
||||||
version: ua.match(/msie ([\d\.]+);/i)[1]
|
version: ua.match(/msie (\d+(\.\d+)?);/i)[1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (chrome) {
|
if (chrome) {
|
||||||
return {
|
return {
|
||||||
webkit: 1,
|
webkit: t,
|
||||||
chrome: 1,
|
chrome: t,
|
||||||
version: ua.match(/chrome\/([\d\.]+)/i)[1]
|
version: ua.match(/chrome\/(\d+(\.\d+)?)/i)[1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (safari) {
|
if (safari) {
|
||||||
return {
|
return {
|
||||||
webkit: 1,
|
webkit: t,
|
||||||
safari: 1,
|
safari: t,
|
||||||
version: ua.match(/version\/([\d\.]+)/i)[1]
|
version: ua.match(/version\/(\d+(\.\d+)?)/i)[1]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (opera) {
|
if (opera) {
|
||||||
return {
|
return {
|
||||||
opera: 1,
|
opera: t,
|
||||||
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: t,
|
||||||
version: ua.match(/firefox\/([\d\.]+)/i)[1]
|
version: ua.match(/firefox\/(\d+(\.\d+)?)/i)[1]
|
||||||
};
|
};
|
||||||
if (firefox) {
|
if (firefox) {
|
||||||
o.firefox = 1;
|
o.firefox = t;
|
||||||
}
|
}
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
@ -66,7 +78,7 @@
|
|||||||
(bowser.firefox && bowser.version >= 3.6) ||
|
(bowser.firefox && bowser.version >= 3.6) ||
|
||||||
(bowser.safari && bowser.version >= 5) ||
|
(bowser.safari && bowser.version >= 5) ||
|
||||||
(bowser.opera && bowser.version >= 9.5)) {
|
(bowser.opera && bowser.version >= 9.5)) {
|
||||||
bowser.a = true;
|
bowser.a = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if ((bowser.msie && bowser.version < 6) ||
|
else if ((bowser.msie && bowser.version < 6) ||
|
||||||
@ -74,13 +86,13 @@
|
|||||||
(bowser.firefox && bowser.version < 3.6) ||
|
(bowser.firefox && bowser.version < 3.6) ||
|
||||||
(bowser.safari && bowser.version < 5) ||
|
(bowser.safari && bowser.version < 5) ||
|
||||||
(bowser.opera && bowser.version < 9.5)) {
|
(bowser.opera && bowser.version < 9.5)) {
|
||||||
bowser.c = true;
|
bowser.c = t;
|
||||||
} else {
|
} else {
|
||||||
bowser.x = true;
|
bowser.x = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeof module !== 'undefined' && module.exports ?
|
typeof module !== 'undefined' && module.exports ?
|
||||||
(module.exports.browser = bowser) :
|
(module.exports.browser = bowser) :
|
||||||
(context.bowser = bowser);
|
(context.bowser = bowser);
|
||||||
|
|
||||||
}(this);
|
}(this,true);
|
Loading…
Reference in New Issue
Block a user