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

6 lines
1.2 KiB
JavaScript
Raw Normal View History

2011-04-27 22:14:35 +00:00
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2011
2011-04-27 22:14:35 +00:00
*/
!function(a,b){typeof define=="function"?define(b):typeof module!="undefined"&&module.exports?module.exports.browser=b():this[a]=b()}("bowser",function(){function l(){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,version:a.match(k)[1]};if(g)return{webkit:b,android:b,mobile:b,version:a.match(k)[1]};if(e)return{webkit:b,safari:b,version:a.match(k)[1]};if(h)return{opera:b,version:a.match(k)[1]};if(j){var l={gecko:b,version:a.match(/firefox\/(\d+(\.\d+)?)/i)[1]};return i&&(l.firefox=b),l}}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=/android/i.test(a),h=/opera/i.test(a),i=/firefox/i.test(a),j=/gecko\//i.test(a),k=/version\/(\d+(\.\d+)?)/i,m=l();return m.msie&&m.version>=6||m.chrome&&m.version>=8||m.firefox&&m.version>=3.6||m.safari&&m.version>=5||m.opera&&m.version>=9.5?m.a=b:m.msie&&m.version<6||m.chrome&&m.version<8||m.firefox&&m.version<3.6||m.safari&&m.version<5||m.opera&&m.version<9.5?m.c=b:m.x=b,m})