1 function get_browser_agent()
3 var ua = navigator.userAgent.toLowerCase();
4 var opera = ((ua.indexOf('opera') != -1) ? true : false);
5 var espial = ((ua.indexOf('escape') != -1) ? true : false);
6 var safari = ((ua.indexOf('safari') != -1) ? true : false);
7 var firefox = ((ua.indexOf('firefox') != -1) ? true : false);
8 var msie = ((ua.indexOf('msie') != -1) ? true : false);
9 var mac = ((ua.indexOf('mac') != -1) ? true : false);
10 var unix = ((ua.indexOf('x11') != -1) ? true : false);
11 var win = ((mac || unix) ? false : true);
15 if (!firefox && !safari && (ua.indexOf('gecko') != -1)) {
17 var _tmp = ua.split('/');
18 version = _tmp[_tmp.length - 1].split(' ')[0];
23 var _tmp = ua.split('/');
24 version = _tmp[_tmp.length - 1].split(' ')[0];
27 version = ua.substring((ua.indexOf('msie ') + 5)).split(';')[0];
32 * Safari doesn't report a string, have to use getBrowserEngine to get it
34 // version = this.getBrowserEngine().version;
35 version = ua.substring((ua.indexOf('safari/') + 7)).split(' ')[0];
40 version = ua.substring((ua.indexOf('opera/') + 6)).split(' ')[0];
43 * Return the Browser Object
47 ua: navigator.userAgent,