mirror of
https://github.com/lancedikson/bowser
synced 2024-10-27 20:34:22 +00:00
7 lines
740 B
JavaScript
7 lines
740 B
JavaScript
/*!
|
|
* Bowser - a browser detector
|
|
* copyright Dustin Diaz 2011
|
|
* https://github.com/ded/bowser
|
|
* 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);typeof module!="undefined"&&module.exports?module.exports.browser=i:a.bowser=i}(this) |