js 读取浏览器信息
var useragent = navigator.userAgent.toLowerCase();
var webtv = useragent.indexOf('webtv') != -1;
var kon = useragent.indexOf('konqueror') != -1;
var mac = useragent.indexOf('mac') != -1;
var saf = useragent.indexOf('applewebkit') != -1 || navigator.vendor == 'Apple Computer, Inc.';
var opera = useragent.indexOf('opera') != -1 && opera.version();
var moz = (navigator.product == 'Gecko' && !saf) && useragent.substr(useragent.indexOf('firefox') + 8, 3);
var ns = useragent.indexOf('compatible') == -1 && useragent.indexOf('mozilla') != -1 && !opera && !webtv && !saf;
var ie = (useragent.indexOf('msie') != -1 && !opera && !saf && !webtv) && useragent.substr(useragent.indexOf('msie') + 5, 3);
时间: 2024-10-27 07:00:15