var ua = navigator.userAgent;
var browser = {},
mobile = ua.match(/(nokia|iPad|iPod|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i),
weixin = ua.match(/MicroMessenger\/([^\s]+)/),
webkit = ua.match(/WebKit\/([\d.]+)/),
android = ua.match(/(Android)\s+([\d.]+)/),
ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
ipod = ua.match(/(iPod).*OS\s([\d_]+)/),
iphone = !ipod && !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),
touchpad = webos && ua.match(/TouchPad/),
kindle = ua.match(/Kindle\/([\d.]+)/),
silk = ua.match(/Silk\/([\d._]+)/),
blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/),
mqqbrowser = ua.match(/MQQBrowser\/([\d.]+)/),
chrome = ua.match(/CriOS\/([\d.]+)/),
opera = ua.match(/Opera\/([\d.]+)/),
safari = ua.match(/Safari\/([\d.]+)/),
mqq = ua.match(/QQ\/([\d.]+)/),
ucbrowser = ua.match(/UCBrowser\/([\d.]+)/),
qqnews = ua.match(/qqnews\/([\d.]+)/),
qqvideo = ua.match(/QQLiveBrowser\/([\d.]+)/);
var browser = {},
mobile = ua.match(/(nokia|iPad|iPod|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i),
weixin = ua.match(/MicroMessenger\/([^\s]+)/),
webkit = ua.match(/WebKit\/([\d.]+)/),
android = ua.match(/(Android)\s+([\d.]+)/),
ipad = ua.match(/(iPad).*OS\s([\d_]+)/),
ipod = ua.match(/(iPod).*OS\s([\d_]+)/),
iphone = !ipod && !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/),
webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),
touchpad = webos && ua.match(/TouchPad/),
kindle = ua.match(/Kindle\/([\d.]+)/),
silk = ua.match(/Silk\/([\d._]+)/),
blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/),
mqqbrowser = ua.match(/MQQBrowser\/([\d.]+)/),
chrome = ua.match(/CriOS\/([\d.]+)/),
opera = ua.match(/Opera\/([\d.]+)/),
safari = ua.match(/Safari\/([\d.]+)/),
mqq = ua.match(/QQ\/([\d.]+)/),
ucbrowser = ua.match(/UCBrowser\/([\d.]+)/),
qqnews = ua.match(/qqnews\/([\d.]+)/),
qqvideo = ua.match(/QQLiveBrowser\/([\d.]+)/);