diff --git a/lib/express-useragent.js b/lib/express-useragent.js index 829eeb5..cfd56b8 100644 --- a/lib/express-useragent.js +++ b/lib/express-useragent.js @@ -1072,10 +1072,21 @@ * boolean flag `isiOSStandalone`, `isiOSUiwebview` and `isAndroidWebview` will be set as side effect. */ UserAgent.prototype.testWebview = function() { - if (this.Agent.os === 'iOS' && isBrowser) { - if (window.navigator.standalone && !this.Agent.isSafari) { + var isiOS = ['iOS', 'OS X'].indexOf(this.Agent.os) !== -1 || (this.Agent.isiPad || this.Agent.isiPod || this.Agent.isiPhone); + var isStandaloneBrowser = + this.Agent.isYaBrowser || + this.Agent.isOpera || + this.Agent.isIE || + this.Agent.isEdge || + this.Agent.isSafari || + this.Agent.isFirefox || + this.Agent.isChrome || + this.Agent.isUC; + + if (isiOS && isBrowser) { + if (window.navigator.standalone && !isStandaloneBrowser) { this.Agent.isiOSStandalone = true; - } else if (!window.navigator.standalone && !this.Agent.isSafari) { + } else if (!window.navigator.standalone && !isStandaloneBrowser) { this.Agent.isiOSUiwebview = true; } } else if (this.Agent.isAndroid) { diff --git a/lib/express-useragent.min.js b/lib/express-useragent.min.js index 4532093..fcf9ed8 100644 --- a/lib/express-useragent.min.js +++ b/lib/express-useragent.min.js @@ -3,4 +3,4 @@ * Copyright 2011-2021 Aleksejs Gordejevs * Licensed under MIT (https://github.com/biggora/express-useragent/blob/master/README.md#license) */ -!function(a){"use strict";function b(a){this.getter=a}function c(a,b){return this instanceof c?("string"!=typeof a&&(a=""),this.version="1.0.16",this.Agent={},this.reset(),this.Agent.source=a.replace(/^\s*/,"").replace(/\s*$/,""),this.Agent.source&&(this.Agent.os=this.getOS(),this.Agent.platform=this.getPlatform(),this.Agent.browser=this.getBrowser(),this.Agent.version=this.getBrowserVersion(),this.Agent.electronVersion=this.getElectronVersion(),this.testWebview(),this.testBot(),this.testSmartTV(),this.testMobile(),this.testAndroidTablet(),this.testTablet(),this.testCompatibilityMode(),this.testSilk(),this.testKindleFire(),this.testCaptiveNetwork(),this.testWebkit(),this.testWechat()),b&&"object"==typeof b&&this.testNginxGeoIP(b),this.DefaultAgent={},void this.reset("DefaultAgent")):new c(a)}b.prototype.getValue=function(){return this.getter()};var d="object"==typeof window&&"object"==typeof window.navigator,e=["\\+https:\\/\\/developers.google.com\\/\\+\\/web\\/snippet\\/","ad\\smonitoring","adsbot","apex","applebot","archive.org_bot","baiduspider","bingbot","chromeheadless","cloudflare","cloudinary","crawler","curl","discordbot","duckduckbot","embedly","exabot","facebookexternalhit","facebot","flipboard","google","googlebot","gsa-crawler","gurujibot","guzzlehttp","heritrix","ia_archiver","insights","linkedinbot","ltx71","mediapartners","msnbot","odklbot","phantom\\.js","phantomjs","pingdom","pinterest","python","rtlnieuws","skypeuripreview","slackbot","slurp","spbot","telegrambot","test\\scertificate","testing","tiabot","tumblr ","twitterbot","vkshare","web\\sscraper","wget","yandexbot","whatsapp","orangebot","smtbot","qwantify","mj12bot","ahrefsbot","seznambot","panscient.com","duckduckgo-favicons-bot","uptimerobot","semrushbot","postman","dotbot","zoominfobot","ifttt","sogou","ru_bot","researchscan","nimbostratus-bot","slack-imgproxy","node-superagent","go-http-client","jersey","dataprovider.com","github-camo","dispatch","checkmarknetwork","screaming frog","whatweb","daum","netcraftsurveyagent","mojeekbot","surdotlybot","springbot"],f=new RegExp("^.*("+e.join("|")+").*$"),g={Edge:/(?:edge|edga|edgios|edg)\/([\d\w\.\-]+)/i,Firefox:/(?:firefox|fxios)\/([\d\w\.\-]+)/i,IE:/msie\s([\d\.]+[\d])|trident\/\d+\.\d+;.*[rv:]+(\d+\.\d)/i,Chrome:/(?:chrome|crios)\/([\d\w\.\-]+)/i,Chromium:/chromium\/([\d\w\.\-]+)/i,Safari:/(version|safari)\/([\d\w\.\-]+)/i,Opera:/version\/([\d\w\.\-]+)|OPR\/([\d\w\.\-]+)/i,Ps3:/([\d\w\.\-]+)\)\s*$/i,Psp:/([\d\w\.\-]+)\)?\s*$/i,Amaya:/amaya\/([\d\w\.\-]+)/i,SeaMonkey:/seamonkey\/([\d\w\.\-]+)/i,OmniWeb:/omniweb\/v([\d\w\.\-]+)/i,Flock:/flock\/([\d\w\.\-]+)/i,Epiphany:/epiphany\/([\d\w\.\-]+)/i,WinJs:/msapphost\/([\d\w\.\-]+)/i,PhantomJS:/phantomjs\/([\d\w\.\-]+)/i,AlamoFire:/alamofire\/([\d\w\.\-]+)/i,UC:/ucbrowser\/([\d\w\.]+)/i,Facebook:/FBAV\/([\d\w\.]+)/i,WebKit:/applewebkit\/([\d\w\.]+)/i,Wechat:/micromessenger\/([\d\w\.]+)/i,Electron:/Electron\/([\d\w\.]+)/i},h={YaBrowser:/yabrowser/i,Edge:/edge|edga|edgios|edg/i,Amaya:/amaya/i,Konqueror:/konqueror/i,Epiphany:/epiphany/i,SeaMonkey:/seamonkey/i,Flock:/flock/i,OmniWeb:/omniweb/i,Chromium:/chromium/i,Chrome:/chrome|crios/i,Safari:/safari/i,IE:/msie|trident/i,Opera:/opera|OPR\//i,PS3:/playstation 3/i,PSP:/playstation portable/i,Firefox:/firefox|fxios/i,WinJs:/msapphost/i,PhantomJS:/phantomjs/i,AlamoFire:/alamofire/i,UC:/UCBrowser/i,Facebook:/FBA[NV]/},i={Windows10:/windows nt 10\.0/i,Windows81:/windows nt 6\.3/i,Windows8:/windows nt 6\.2/i,Windows7:/windows nt 6\.1/i,UnknownWindows:/windows nt 6\.\d+/i,WindowsVista:/windows nt 6\.0/i,Windows2003:/windows nt 5\.2/i,WindowsXP:/windows nt 5\.1/i,Windows2000:/windows nt 5\.0/i,WindowsPhone81:/windows phone 8\.1/i,WindowsPhone80:/windows phone 8\.0/i,OSXCheetah:/os x 10[._]0/i,OSXPuma:/os x 10[._]1(\D|$)/i,OSXJaguar:/os x 10[._]2/i,OSXPanther:/os x 10[._]3/i,OSXTiger:/os x 10[._]4/i,OSXLeopard:/os x 10[._]5/i,OSXSnowLeopard:/os x 10[._]6/i,OSXLion:/os x 10[._]7/i,OSXMountainLion:/os x 10[._]8/i,OSXMavericks:/os x 10[._]9/i,OSXYosemite:/os x 10[._]10/i,OSXElCapitan:/os x 10[._]11/i,MacOSSierra:/os x 10[._]12/i,MacOSHighSierra:/os x 10[._]13/i,MacOSMojave:/os x 10[._]14/i,Mac:/os x/i,Linux:/linux/i,Linux64:/linux x86\_64/i,ChromeOS:/cros/i,Wii:/wii/i,PS3:/playstation 3/i,PSP:/playstation portable/i,iPad:/\(iPad.*os (\d+)[._](\d+)/i,iPhone:/\(iPhone.*os (\d+)[._](\d+)/i,iOS:/ios/i,Bada:/Bada\/(\d+)\.(\d+)/i,Curl:/curl\/(\d+)\.(\d+)\.(\d+)/i,Electron:/Electron\/(\d+)\.(\d+)\.(\d+)/i},j={Windows:/windows nt/i,WindowsPhone:/windows phone/i,Mac:/macintosh/i,Linux:/linux/i,Wii:/wii/i,Playstation:/playstation/i,iPad:/ipad/i,iPod:/ipod/i,iPhone:/iphone/i,Android:/android/i,Blackberry:/blackberry/i,Samsung:/samsung/i,Curl:/curl/i,Electron:/Electron/i,iOS:/^ios\-/i},k={isYaBrowser:!1,isAuthoritative:!0,isMobile:!1,isMobileNative:!1,isTablet:!1,isiPad:!1,isiPod:!1,isiPhone:!1,isiPhoneNative:!1,isiOSStandalone:!1,isiOSUiwebview:!1,isAndroid:!1,isAndroidNative:!1,isAndroidWebview:!1,isBlackberry:!1,isOpera:!1,isIE:!1,isEdge:!1,isIECompatibilityMode:!1,isSafari:!1,isFirefox:!1,isWebkit:!1,isChrome:!1,isKonqueror:!1,isOmniWeb:!1,isSeaMonkey:!1,isFlock:!1,isAmaya:!1,isPhantomJS:!1,isEpiphany:!1,isDesktop:!1,isWindows:!1,isLinux:!1,isLinux64:!1,isMac:!1,isChromeOS:!1,isBada:!1,isSamsung:!1,isRaspberry:!1,isBot:!1,isCurl:!1,isAndroidTablet:!1,isWinJs:!1,isKindleFire:!1,isSilk:!1,isCaptive:!1,isSmartTV:!1,isUC:!1,isFacebook:!1,isAlamoFire:!1,isElectron:!1,isWechat:!1,silkAccelerated:!1,browser:"unknown",version:"unknown",os:"unknown",platform:"unknown",geoIp:new b(function(){return{}}),source:""};c.prototype.getBrowser=function(a){switch(a=a||this.Agent.source,!0){case h.YaBrowser.test(a):return this.Agent.isYaBrowser=!0,"YaBrowser";case h.AlamoFire.test(a):return this.Agent.isAlamoFire=!0,"AlamoFire";case h.Edge.test(a):return this.Agent.isEdge=!0,"Edge";case h.PhantomJS.test(a):return this.Agent.isPhantomJS=!0,"PhantomJS";case h.Konqueror.test(a):return this.Agent.isKonqueror=!0,"Konqueror";case h.Amaya.test(a):return this.Agent.isAmaya=!0,"Amaya";case h.Epiphany.test(a):return this.Agent.isEpiphany=!0,"Epiphany";case h.SeaMonkey.test(a):return this.Agent.isSeaMonkey=!0,"SeaMonkey";case h.Flock.test(a):return this.Agent.isFlock=!0,"Flock";case h.OmniWeb.test(a):return this.Agent.isOmniWeb=!0,"OmniWeb";case h.Opera.test(a):return this.Agent.isOpera=!0,"Opera";case h.Chromium.test(a):return this.Agent.isChrome=!0,"Chromium";case h.Facebook.test(a):return this.Agent.isFacebook=!0,"Facebook";case h.Chrome.test(a):return this.Agent.isChrome=!0,"Chrome";case h.WinJs.test(a):return this.Agent.isWinJs=!0,"WinJs";case h.IE.test(a):return this.Agent.isIE=!0,"IE";case h.Firefox.test(a):return this.Agent.isFirefox=!0,"Firefox";case h.Safari.test(a):return this.Agent.isSafari=!0,"Safari";case h.PS3.test(a):return"ps3";case h.PSP.test(a):return"psp";case h.UC.test(a):return this.Agent.isUC=!0,"UCBrowser";default:return a.indexOf("Dalvik")!==-1?"unknown":0!==a.indexOf("Mozilla")&&/^([\d\w\-\.]+)\/[\d\w\.\-]+/i.test(a)?(this.Agent.isAuthoritative=!1,RegExp.$1):"unknown"}},c.prototype.getBrowserVersion=function(a){a=a||this.Agent.source;var b;switch(this.Agent.browser){case"Edge":if(g.Edge.test(a))return RegExp.$1;break;case"PhantomJS":if(g.PhantomJS.test(a))return RegExp.$1;break;case"Chrome":if(g.Chrome.test(a))return RegExp.$1;break;case"Chromium":if(g.Chromium.test(a))return RegExp.$1;break;case"Safari":if(g.Safari.test(a))return RegExp.$2;break;case"Opera":if(g.Opera.test(a))return RegExp.$1?RegExp.$1:RegExp.$2;break;case"Firefox":if(g.Firefox.test(a))return RegExp.$1;break;case"WinJs":if(g.WinJs.test(a))return RegExp.$1;break;case"IE":if(g.IE.test(a))return RegExp.$2?RegExp.$2:RegExp.$1;break;case"ps3":if(g.Ps3.test(a))return RegExp.$1;break;case"psp":if(g.Psp.test(a))return RegExp.$1;break;case"Amaya":if(g.Amaya.test(a))return RegExp.$1;break;case"Epiphany":if(g.Epiphany.test(a))return RegExp.$1;break;case"SeaMonkey":if(g.SeaMonkey.test(a))return RegExp.$1;break;case"Flock":if(g.Flock.test(a))return RegExp.$1;break;case"OmniWeb":if(g.OmniWeb.test(a))return RegExp.$1;break;case"UCBrowser":if(g.UC.test(a))return RegExp.$1;break;case"Facebook":if(g.Facebook.test(a))return RegExp.$1;break;default:if("unknown"===this.Agent.browser)return this.testWebkit(),this.Agent.isWebkit&&g.WebKit.test(a)?RegExp.$1:"unknown";if(b=new RegExp(this.Agent.browser+"[\\/ ]([\\d\\w\\.\\-]+)","i"),b.test(a))return RegExp.$1}},c.prototype.getWechatVersion=function(a){return a=a||this.Agent.source,g.Wechat.test(a)?RegExp.$1:"unknown"},c.prototype.getElectronVersion=function(a){return a=a||this.Agent.source,g.Electron.test(a)?(this.Agent.isElectron=!0,RegExp.$1):""},c.prototype.getOS=function(a){switch(a=a||this.Agent.source,!0){case i.WindowsVista.test(a):return this.Agent.isWindows=!0,"Windows Vista";case i.Windows7.test(a):return this.Agent.isWindows=!0,"Windows 7";case i.Windows8.test(a):return this.Agent.isWindows=!0,"Windows 8";case i.Windows81.test(a):return this.Agent.isWindows=!0,"Windows 8.1";case i.Windows10.test(a):return this.Agent.isWindows=!0,"Windows 10.0";case i.Windows2003.test(a):return this.Agent.isWindows=!0,"Windows 2003";case i.WindowsXP.test(a):return this.Agent.isWindows=!0,"Windows XP";case i.Windows2000.test(a):return this.Agent.isWindows=!0,"Windows 2000";case i.WindowsPhone81.test(a):return this.Agent.isWindowsPhone=!0,"Windows Phone 8.1";case i.WindowsPhone80.test(a):return this.Agent.isWindowsPhone=!0,"Windows Phone 8.0";case i.Linux64.test(a):return this.Agent.isLinux=!0,this.Agent.isLinux64=!0,"Linux 64";case i.Linux.test(a):return this.Agent.isLinux=!0,"Linux";case i.ChromeOS.test(a):return this.Agent.isChromeOS=!0,"Chrome OS";case i.Wii.test(a):return"Wii";case i.PS3.test(a):return"Playstation";case i.PSP.test(a):return"Playstation";case i.OSXCheetah.test(a):return this.Agent.isMac=!0,"OS X Cheetah";case i.OSXPuma.test(a):return this.Agent.isMac=!0,"OS X Puma";case i.OSXJaguar.test(a):return this.Agent.isMac=!0,"OS X Jaguar";case i.OSXPanther.test(a):return this.Agent.isMac=!0,"OS X Panther";case i.OSXTiger.test(a):return this.Agent.isMac=!0,"OS X Tiger";case i.OSXLeopard.test(a):return this.Agent.isMac=!0,"OS X Leopard";case i.OSXSnowLeopard.test(a):return this.Agent.isMac=!0,"OS X Snow Leopard";case i.OSXLion.test(a):return this.Agent.isMac=!0,"OS X Lion";case i.OSXMountainLion.test(a):return this.Agent.isMac=!0,"OS X Mountain Lion";case i.OSXMavericks.test(a):return this.Agent.isMac=!0,"OS X Mavericks";case i.OSXYosemite.test(a):return this.Agent.isMac=!0,"OS X Yosemite";case i.OSXElCapitan.test(a):return this.Agent.isMac=!0,"OS X El Capitan";case i.MacOSSierra.test(a):return this.Agent.isMac=!0,"macOS Sierra";case i.MacOSHighSierra.test(a):return this.Agent.isMac=!0,"macOS High Sierra";case i.MacOSMojave.test(a):return this.Agent.isMac=!0,"macOS Mojave";case i.Mac.test(a):return d&&"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1?(this.Agent.isiPad=!0,"iOS 13+"):(this.Agent.isMac=!0,"OS X");case i.iPad.test(a):return this.Agent.isiPad=!0,a.match(i.iPad)[0].replace("_",".");case i.iPhone.test(a):return this.Agent.isiPhone=!0,a.match(i.iPhone)[0].replace("_",".");case i.Bada.test(a):return this.Agent.isBada=!0,"Bada";case i.Curl.test(a):return this.Agent.isCurl=!0,"Curl";case i.iOS.test(a):return this.Agent.isiPhone=!0,"iOS";case i.Electron.test(a):return this.Agent.isElectron=!0,"Electron";default:return"unknown"}},c.prototype.getPlatform=function(a){switch(a=a||this.Agent.source,!0){case j.Windows.test(a):return"Microsoft Windows";case j.WindowsPhone.test(a):return this.Agent.isWindowsPhone=!0,"Microsoft Windows Phone";case j.Mac.test(a):return d&&"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1?(this.Agent.isiPad=!0,"iPad"):"Apple Mac";case j.Curl.test(a):return"Curl";case j.Electron.test(a):return this.Agent.isElectron=!0,"Electron";case j.Android.test(a):return this.Agent.isAndroid=!0,"Android";case j.Blackberry.test(a):return this.Agent.isBlackberry=!0,"Blackberry";case j.Linux.test(a):return"Linux";case j.Wii.test(a):return"Wii";case j.Playstation.test(a):return"Playstation";case j.iPad.test(a):return this.Agent.isiPad=!0,"iPad";case j.iPod.test(a):return this.Agent.isiPod=!0,"iPod";case j.iPhone.test(a):return this.Agent.isiPhone=!0,"iPhone";case j.Samsung.test(a):return this.Agent.isSamsung=!0,"Samsung";case j.iOS.test(a):return"Apple iOS";default:return"unknown"}},c.prototype.testCompatibilityMode=function(){var a=this;if(this.Agent.isIE&&/Trident\/(\d)\.0/i.test(a.Agent.source)){var b=parseInt(RegExp.$1,10),c=parseInt(a.Agent.version,10);7===c&&7===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=11),7===c&&6===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=10),7===c&&5===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=9),7===c&&4===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=8)}},c.prototype.testSilk=function(){var a=this;switch(!0){case new RegExp("silk","gi").test(a.Agent.source):this.Agent.isSilk=!0}return/Silk-Accelerated=true/gi.test(a.Agent.source)&&(this.Agent.SilkAccelerated=!0),!!this.Agent.isSilk&&"Silk"},c.prototype.testKindleFire=function(){var a=this;switch(!0){case/KFOT/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire";case/KFTT/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD";case/KFJWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 8.9";case/KFJWA/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 8.9 4G";case/KFSOWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 7";case/KFTHWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 7";case/KFTHWA/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 7 4G";case/KFAPWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 8.9";case/KFAPWA/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 8.9 4G";default:return!1}},c.prototype.testCaptiveNetwork=function(){var a=this;switch(!0){case/CaptiveNetwork/gi.test(a.Agent.source):return a.Agent.isCaptive=!0,a.Agent.isMac=!0,a.Agent.platform="Apple Mac","CaptiveNetwork";default:return!1}},c.prototype.reset=function(a){a=a||"Agent",this[a]={};for(var c in k){var d=k[c];d instanceof b&&(d=d.getValue()),this[a][c]=d}return this},c.prototype.testMobile=function(){var a=this;switch(!0){case a.Agent.isWindows:case a.Agent.isLinux:case a.Agent.isMac:case a.Agent.isChromeOS:a.Agent.isDesktop=!0;break;case a.Agent.isAndroid:case a.Agent.isSamsung:a.Agent.isMobile=!0}switch(!0){case a.Agent.isiPad:case a.Agent.isiPod:case a.Agent.isiPhone:case a.Agent.isBada:case a.Agent.isBlackberry:case a.Agent.isAndroid:case a.Agent.isWindowsPhone:a.Agent.isMobile=!0,a.Agent.isDesktop=!1}/mobile|^ios\-/i.test(a.Agent.source)&&(a.Agent.isMobile=!0,a.Agent.isDesktop=!1),/dalvik/i.test(a.Agent.source)&&(a.Agent.isAndroidNative=!0,a.Agent.isMobileNative=!0),/scale/i.test(a.Agent.source)&&(a.Agent.isiPhoneNative=!0,a.Agent.isMobileNative=!0)},c.prototype.testTablet=function(){var a=this;switch(!0){case a.Agent.isiPad:case a.Agent.isAndroidTablet:case a.Agent.isKindleFire:a.Agent.isTablet=!0}/tablet/i.test(a.Agent.source)&&(a.Agent.isTablet=!0)},c.prototype.testNginxGeoIP=function(a){var b=this;return Object.keys(a).forEach(function(c){/^GEOIP/i.test(c)&&(b.Agent.geoIp[c]=a[c])}),b},c.prototype.testBot=function(){var a=this,b=f.exec(a.Agent.source.toLowerCase());b?a.Agent.isBot=b[1]:a.Agent.isAuthoritative||(a.Agent.isBot=/bot/i.test(a.Agent.source))},c.prototype.testSmartTV=function(){var a=this;a.Agent.isSmartTV=new RegExp("smart-tv|smarttv|googletv|appletv|hbbtv|pov_tv|netcast.tv","gi").test(a.Agent.source.toLowerCase())},c.prototype.testAndroidTablet=function(){var a=this;a.Agent.isAndroid&&!/mobile/i.test(a.Agent.source)&&(a.Agent.isAndroidTablet=!0)},c.prototype.testWebkit=function(){var a=this;"unknown"===a.Agent.browser&&/applewebkit/i.test(a.Agent.source)&&(a.Agent.browser="Apple WebKit",a.Agent.isWebkit=!0)},c.prototype.testWechat=function(){var a=this;/micromessenger/i.test(a.Agent.source)&&(a.Agent.isWechat=!0,a.Agent.version=this.getWechatVersion(a.Agent.source))},c.prototype.testWebview=function(){"iOS"===this.Agent.os&&d?window.navigator.standalone&&!this.Agent.isSafari?this.Agent.isiOSStandalone=!0:window.navigator.standalone||this.Agent.isSafari||(this.Agent.isiOSUiwebview=!0):this.Agent.isAndroid&&/; ?wv\)/i.test(this.Agent.source)&&(this.Agent.isAndroidWebview=!0)},c.prototype.parse=function(a){try{console.warn("The `userAgentInstance.parse` method from instance is deprecated, use the static method instead: `UserAgent.parse`.")}catch(b){}return c.parse(a)},c.parse=function(a){var b=new c(a);return b.Agent},c.testNginxGeoIP=function(a){return new c(null,a)},a.UserAgent=c}(this); \ No newline at end of file +!function(a){"use strict";function b(a){this.getter=a}function c(a,b){return this instanceof c?("string"!=typeof a&&(a=""),this.version="1.0.16",this.Agent={},this.reset(),this.Agent.source=a.replace(/^\s*/,"").replace(/\s*$/,""),this.Agent.source&&(this.Agent.os=this.getOS(),this.Agent.platform=this.getPlatform(),this.Agent.browser=this.getBrowser(),this.Agent.version=this.getBrowserVersion(),this.Agent.electronVersion=this.getElectronVersion(),this.testWebview(),this.testBot(),this.testSmartTV(),this.testMobile(),this.testAndroidTablet(),this.testTablet(),this.testCompatibilityMode(),this.testSilk(),this.testKindleFire(),this.testCaptiveNetwork(),this.testWebkit(),this.testWechat()),b&&"object"==typeof b&&this.testNginxGeoIP(b),this.DefaultAgent={},void this.reset("DefaultAgent")):new c(a)}b.prototype.getValue=function(){return this.getter()};var d="object"==typeof window&&"object"==typeof window.navigator,e=["\\+https:\\/\\/developers.google.com\\/\\+\\/web\\/snippet\\/","ad\\smonitoring","adsbot","apex","applebot","archive.org_bot","baiduspider","bingbot","chromeheadless","cloudflare","cloudinary","crawler","curl","discordbot","duckduckbot","embedly","exabot","facebookexternalhit","facebot","flipboard","google","googlebot","gsa-crawler","gurujibot","guzzlehttp","heritrix","ia_archiver","insights","linkedinbot","ltx71","mediapartners","msnbot","odklbot","phantom\\.js","phantomjs","pingdom","pinterest","python","rtlnieuws","skypeuripreview","slackbot","slurp","spbot","telegrambot","test\\scertificate","testing","tiabot","tumblr ","twitterbot","vkshare","web\\sscraper","wget","yandexbot","whatsapp","orangebot","smtbot","qwantify","mj12bot","ahrefsbot","seznambot","panscient.com","duckduckgo-favicons-bot","uptimerobot","semrushbot","postman","dotbot","zoominfobot","ifttt","sogou","ru_bot","researchscan","nimbostratus-bot","slack-imgproxy","node-superagent","go-http-client","jersey","dataprovider.com","github-camo","dispatch","checkmarknetwork","screaming frog","whatweb","daum","netcraftsurveyagent","mojeekbot","surdotlybot","springbot"],f=new RegExp("^.*("+e.join("|")+").*$"),g={Edge:/(?:edge|edga|edgios|edg)\/([\d\w\.\-]+)/i,Firefox:/(?:firefox|fxios)\/([\d\w\.\-]+)/i,IE:/msie\s([\d\.]+[\d])|trident\/\d+\.\d+;.*[rv:]+(\d+\.\d)/i,Chrome:/(?:chrome|crios)\/([\d\w\.\-]+)/i,Chromium:/chromium\/([\d\w\.\-]+)/i,Safari:/(version|safari)\/([\d\w\.\-]+)/i,Opera:/version\/([\d\w\.\-]+)|OPR\/([\d\w\.\-]+)/i,Ps3:/([\d\w\.\-]+)\)\s*$/i,Psp:/([\d\w\.\-]+)\)?\s*$/i,Amaya:/amaya\/([\d\w\.\-]+)/i,SeaMonkey:/seamonkey\/([\d\w\.\-]+)/i,OmniWeb:/omniweb\/v([\d\w\.\-]+)/i,Flock:/flock\/([\d\w\.\-]+)/i,Epiphany:/epiphany\/([\d\w\.\-]+)/i,WinJs:/msapphost\/([\d\w\.\-]+)/i,PhantomJS:/phantomjs\/([\d\w\.\-]+)/i,AlamoFire:/alamofire\/([\d\w\.\-]+)/i,UC:/ucbrowser\/([\d\w\.]+)/i,Facebook:/FBAV\/([\d\w\.]+)/i,WebKit:/applewebkit\/([\d\w\.]+)/i,Wechat:/micromessenger\/([\d\w\.]+)/i,Electron:/Electron\/([\d\w\.]+)/i},h={YaBrowser:/yabrowser/i,Edge:/edge|edga|edgios|edg/i,Amaya:/amaya/i,Konqueror:/konqueror/i,Epiphany:/epiphany/i,SeaMonkey:/seamonkey/i,Flock:/flock/i,OmniWeb:/omniweb/i,Chromium:/chromium/i,Chrome:/chrome|crios/i,Safari:/safari/i,IE:/msie|trident/i,Opera:/opera|OPR\//i,PS3:/playstation 3/i,PSP:/playstation portable/i,Firefox:/firefox|fxios/i,WinJs:/msapphost/i,PhantomJS:/phantomjs/i,AlamoFire:/alamofire/i,UC:/UCBrowser/i,Facebook:/FBA[NV]/},i={Windows10:/windows nt 10\.0/i,Windows81:/windows nt 6\.3/i,Windows8:/windows nt 6\.2/i,Windows7:/windows nt 6\.1/i,UnknownWindows:/windows nt 6\.\d+/i,WindowsVista:/windows nt 6\.0/i,Windows2003:/windows nt 5\.2/i,WindowsXP:/windows nt 5\.1/i,Windows2000:/windows nt 5\.0/i,WindowsPhone81:/windows phone 8\.1/i,WindowsPhone80:/windows phone 8\.0/i,OSXCheetah:/os x 10[._]0/i,OSXPuma:/os x 10[._]1(\D|$)/i,OSXJaguar:/os x 10[._]2/i,OSXPanther:/os x 10[._]3/i,OSXTiger:/os x 10[._]4/i,OSXLeopard:/os x 10[._]5/i,OSXSnowLeopard:/os x 10[._]6/i,OSXLion:/os x 10[._]7/i,OSXMountainLion:/os x 10[._]8/i,OSXMavericks:/os x 10[._]9/i,OSXYosemite:/os x 10[._]10/i,OSXElCapitan:/os x 10[._]11/i,MacOSSierra:/os x 10[._]12/i,MacOSHighSierra:/os x 10[._]13/i,MacOSMojave:/os x 10[._]14/i,Mac:/os x/i,Linux:/linux/i,Linux64:/linux x86\_64/i,ChromeOS:/cros/i,Wii:/wii/i,PS3:/playstation 3/i,PSP:/playstation portable/i,iPad:/\(iPad.*os (\d+)[._](\d+)/i,iPhone:/\(iPhone.*os (\d+)[._](\d+)/i,iOS:/ios/i,Bada:/Bada\/(\d+)\.(\d+)/i,Curl:/curl\/(\d+)\.(\d+)\.(\d+)/i,Electron:/Electron\/(\d+)\.(\d+)\.(\d+)/i},j={Windows:/windows nt/i,WindowsPhone:/windows phone/i,Mac:/macintosh/i,Linux:/linux/i,Wii:/wii/i,Playstation:/playstation/i,iPad:/ipad/i,iPod:/ipod/i,iPhone:/iphone/i,Android:/android/i,Blackberry:/blackberry/i,Samsung:/samsung/i,Curl:/curl/i,Electron:/Electron/i,iOS:/^ios\-/i},k={isYaBrowser:!1,isAuthoritative:!0,isMobile:!1,isMobileNative:!1,isTablet:!1,isiPad:!1,isiPod:!1,isiPhone:!1,isiPhoneNative:!1,isiOSStandalone:!1,isiOSUiwebview:!1,isAndroid:!1,isAndroidNative:!1,isAndroidWebview:!1,isBlackberry:!1,isOpera:!1,isIE:!1,isEdge:!1,isIECompatibilityMode:!1,isSafari:!1,isFirefox:!1,isWebkit:!1,isChrome:!1,isKonqueror:!1,isOmniWeb:!1,isSeaMonkey:!1,isFlock:!1,isAmaya:!1,isPhantomJS:!1,isEpiphany:!1,isDesktop:!1,isWindows:!1,isLinux:!1,isLinux64:!1,isMac:!1,isChromeOS:!1,isBada:!1,isSamsung:!1,isRaspberry:!1,isBot:!1,isCurl:!1,isAndroidTablet:!1,isWinJs:!1,isKindleFire:!1,isSilk:!1,isCaptive:!1,isSmartTV:!1,isUC:!1,isFacebook:!1,isAlamoFire:!1,isElectron:!1,isWechat:!1,silkAccelerated:!1,browser:"unknown",version:"unknown",os:"unknown",platform:"unknown",geoIp:new b(function(){return{}}),source:""};c.prototype.getBrowser=function(a){switch(a=a||this.Agent.source,!0){case h.YaBrowser.test(a):return this.Agent.isYaBrowser=!0,"YaBrowser";case h.AlamoFire.test(a):return this.Agent.isAlamoFire=!0,"AlamoFire";case h.Edge.test(a):return this.Agent.isEdge=!0,"Edge";case h.PhantomJS.test(a):return this.Agent.isPhantomJS=!0,"PhantomJS";case h.Konqueror.test(a):return this.Agent.isKonqueror=!0,"Konqueror";case h.Amaya.test(a):return this.Agent.isAmaya=!0,"Amaya";case h.Epiphany.test(a):return this.Agent.isEpiphany=!0,"Epiphany";case h.SeaMonkey.test(a):return this.Agent.isSeaMonkey=!0,"SeaMonkey";case h.Flock.test(a):return this.Agent.isFlock=!0,"Flock";case h.OmniWeb.test(a):return this.Agent.isOmniWeb=!0,"OmniWeb";case h.Opera.test(a):return this.Agent.isOpera=!0,"Opera";case h.Chromium.test(a):return this.Agent.isChrome=!0,"Chromium";case h.Facebook.test(a):return this.Agent.isFacebook=!0,"Facebook";case h.Chrome.test(a):return this.Agent.isChrome=!0,"Chrome";case h.WinJs.test(a):return this.Agent.isWinJs=!0,"WinJs";case h.IE.test(a):return this.Agent.isIE=!0,"IE";case h.Firefox.test(a):return this.Agent.isFirefox=!0,"Firefox";case h.Safari.test(a):return this.Agent.isSafari=!0,"Safari";case h.PS3.test(a):return"ps3";case h.PSP.test(a):return"psp";case h.UC.test(a):return this.Agent.isUC=!0,"UCBrowser";default:return a.indexOf("Dalvik")!==-1?"unknown":0!==a.indexOf("Mozilla")&&/^([\d\w\-\.]+)\/[\d\w\.\-]+/i.test(a)?(this.Agent.isAuthoritative=!1,RegExp.$1):"unknown"}},c.prototype.getBrowserVersion=function(a){a=a||this.Agent.source;var b;switch(this.Agent.browser){case"Edge":if(g.Edge.test(a))return RegExp.$1;break;case"PhantomJS":if(g.PhantomJS.test(a))return RegExp.$1;break;case"Chrome":if(g.Chrome.test(a))return RegExp.$1;break;case"Chromium":if(g.Chromium.test(a))return RegExp.$1;break;case"Safari":if(g.Safari.test(a))return RegExp.$2;break;case"Opera":if(g.Opera.test(a))return RegExp.$1?RegExp.$1:RegExp.$2;break;case"Firefox":if(g.Firefox.test(a))return RegExp.$1;break;case"WinJs":if(g.WinJs.test(a))return RegExp.$1;break;case"IE":if(g.IE.test(a))return RegExp.$2?RegExp.$2:RegExp.$1;break;case"ps3":if(g.Ps3.test(a))return RegExp.$1;break;case"psp":if(g.Psp.test(a))return RegExp.$1;break;case"Amaya":if(g.Amaya.test(a))return RegExp.$1;break;case"Epiphany":if(g.Epiphany.test(a))return RegExp.$1;break;case"SeaMonkey":if(g.SeaMonkey.test(a))return RegExp.$1;break;case"Flock":if(g.Flock.test(a))return RegExp.$1;break;case"OmniWeb":if(g.OmniWeb.test(a))return RegExp.$1;break;case"UCBrowser":if(g.UC.test(a))return RegExp.$1;break;case"Facebook":if(g.Facebook.test(a))return RegExp.$1;break;default:if("unknown"===this.Agent.browser)return this.testWebkit(),this.Agent.isWebkit&&g.WebKit.test(a)?RegExp.$1:"unknown";if(b=new RegExp(this.Agent.browser+"[\\/ ]([\\d\\w\\.\\-]+)","i"),b.test(a))return RegExp.$1}},c.prototype.getWechatVersion=function(a){return a=a||this.Agent.source,g.Wechat.test(a)?RegExp.$1:"unknown"},c.prototype.getElectronVersion=function(a){return a=a||this.Agent.source,g.Electron.test(a)?(this.Agent.isElectron=!0,RegExp.$1):""},c.prototype.getOS=function(a){switch(a=a||this.Agent.source,!0){case i.WindowsVista.test(a):return this.Agent.isWindows=!0,"Windows Vista";case i.Windows7.test(a):return this.Agent.isWindows=!0,"Windows 7";case i.Windows8.test(a):return this.Agent.isWindows=!0,"Windows 8";case i.Windows81.test(a):return this.Agent.isWindows=!0,"Windows 8.1";case i.Windows10.test(a):return this.Agent.isWindows=!0,"Windows 10.0";case i.Windows2003.test(a):return this.Agent.isWindows=!0,"Windows 2003";case i.WindowsXP.test(a):return this.Agent.isWindows=!0,"Windows XP";case i.Windows2000.test(a):return this.Agent.isWindows=!0,"Windows 2000";case i.WindowsPhone81.test(a):return this.Agent.isWindowsPhone=!0,"Windows Phone 8.1";case i.WindowsPhone80.test(a):return this.Agent.isWindowsPhone=!0,"Windows Phone 8.0";case i.Linux64.test(a):return this.Agent.isLinux=!0,this.Agent.isLinux64=!0,"Linux 64";case i.Linux.test(a):return this.Agent.isLinux=!0,"Linux";case i.ChromeOS.test(a):return this.Agent.isChromeOS=!0,"Chrome OS";case i.Wii.test(a):return"Wii";case i.PS3.test(a):return"Playstation";case i.PSP.test(a):return"Playstation";case i.OSXCheetah.test(a):return this.Agent.isMac=!0,"OS X Cheetah";case i.OSXPuma.test(a):return this.Agent.isMac=!0,"OS X Puma";case i.OSXJaguar.test(a):return this.Agent.isMac=!0,"OS X Jaguar";case i.OSXPanther.test(a):return this.Agent.isMac=!0,"OS X Panther";case i.OSXTiger.test(a):return this.Agent.isMac=!0,"OS X Tiger";case i.OSXLeopard.test(a):return this.Agent.isMac=!0,"OS X Leopard";case i.OSXSnowLeopard.test(a):return this.Agent.isMac=!0,"OS X Snow Leopard";case i.OSXLion.test(a):return this.Agent.isMac=!0,"OS X Lion";case i.OSXMountainLion.test(a):return this.Agent.isMac=!0,"OS X Mountain Lion";case i.OSXMavericks.test(a):return this.Agent.isMac=!0,"OS X Mavericks";case i.OSXYosemite.test(a):return this.Agent.isMac=!0,"OS X Yosemite";case i.OSXElCapitan.test(a):return this.Agent.isMac=!0,"OS X El Capitan";case i.MacOSSierra.test(a):return this.Agent.isMac=!0,"macOS Sierra";case i.MacOSHighSierra.test(a):return this.Agent.isMac=!0,"macOS High Sierra";case i.MacOSMojave.test(a):return this.Agent.isMac=!0,"macOS Mojave";case i.Mac.test(a):return d&&"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1?(this.Agent.isiPad=!0,"iOS 13+"):(this.Agent.isMac=!0,"OS X");case i.iPad.test(a):return this.Agent.isiPad=!0,a.match(i.iPad)[0].replace("_",".");case i.iPhone.test(a):return this.Agent.isiPhone=!0,a.match(i.iPhone)[0].replace("_",".");case i.Bada.test(a):return this.Agent.isBada=!0,"Bada";case i.Curl.test(a):return this.Agent.isCurl=!0,"Curl";case i.iOS.test(a):return this.Agent.isiPhone=!0,"iOS";case i.Electron.test(a):return this.Agent.isElectron=!0,"Electron";default:return"unknown"}},c.prototype.getPlatform=function(a){switch(a=a||this.Agent.source,!0){case j.Windows.test(a):return"Microsoft Windows";case j.WindowsPhone.test(a):return this.Agent.isWindowsPhone=!0,"Microsoft Windows Phone";case j.Mac.test(a):return d&&"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1?(this.Agent.isiPad=!0,"iPad"):"Apple Mac";case j.Curl.test(a):return"Curl";case j.Electron.test(a):return this.Agent.isElectron=!0,"Electron";case j.Android.test(a):return this.Agent.isAndroid=!0,"Android";case j.Blackberry.test(a):return this.Agent.isBlackberry=!0,"Blackberry";case j.Linux.test(a):return"Linux";case j.Wii.test(a):return"Wii";case j.Playstation.test(a):return"Playstation";case j.iPad.test(a):return this.Agent.isiPad=!0,"iPad";case j.iPod.test(a):return this.Agent.isiPod=!0,"iPod";case j.iPhone.test(a):return this.Agent.isiPhone=!0,"iPhone";case j.Samsung.test(a):return this.Agent.isSamsung=!0,"Samsung";case j.iOS.test(a):return"Apple iOS";default:return"unknown"}},c.prototype.testCompatibilityMode=function(){var a=this;if(this.Agent.isIE&&/Trident\/(\d)\.0/i.test(a.Agent.source)){var b=parseInt(RegExp.$1,10),c=parseInt(a.Agent.version,10);7===c&&7===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=11),7===c&&6===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=10),7===c&&5===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=9),7===c&&4===b&&(a.Agent.isIECompatibilityMode=!0,a.Agent.version=8)}},c.prototype.testSilk=function(){var a=this;switch(!0){case new RegExp("silk","gi").test(a.Agent.source):this.Agent.isSilk=!0}return/Silk-Accelerated=true/gi.test(a.Agent.source)&&(this.Agent.SilkAccelerated=!0),!!this.Agent.isSilk&&"Silk"},c.prototype.testKindleFire=function(){var a=this;switch(!0){case/KFOT/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire";case/KFTT/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD";case/KFJWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 8.9";case/KFJWA/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 8.9 4G";case/KFSOWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HD 7";case/KFTHWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 7";case/KFTHWA/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 7 4G";case/KFAPWI/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 8.9";case/KFAPWA/gi.test(a.Agent.source):return this.Agent.isKindleFire=!0,"Kindle Fire HDX 8.9 4G";default:return!1}},c.prototype.testCaptiveNetwork=function(){var a=this;switch(!0){case/CaptiveNetwork/gi.test(a.Agent.source):return a.Agent.isCaptive=!0,a.Agent.isMac=!0,a.Agent.platform="Apple Mac","CaptiveNetwork";default:return!1}},c.prototype.reset=function(a){a=a||"Agent",this[a]={};for(var c in k){var d=k[c];d instanceof b&&(d=d.getValue()),this[a][c]=d}return this},c.prototype.testMobile=function(){var a=this;switch(!0){case a.Agent.isWindows:case a.Agent.isLinux:case a.Agent.isMac:case a.Agent.isChromeOS:a.Agent.isDesktop=!0;break;case a.Agent.isAndroid:case a.Agent.isSamsung:a.Agent.isMobile=!0}switch(!0){case a.Agent.isiPad:case a.Agent.isiPod:case a.Agent.isiPhone:case a.Agent.isBada:case a.Agent.isBlackberry:case a.Agent.isAndroid:case a.Agent.isWindowsPhone:a.Agent.isMobile=!0,a.Agent.isDesktop=!1}/mobile|^ios\-/i.test(a.Agent.source)&&(a.Agent.isMobile=!0,a.Agent.isDesktop=!1),/dalvik/i.test(a.Agent.source)&&(a.Agent.isAndroidNative=!0,a.Agent.isMobileNative=!0),/scale/i.test(a.Agent.source)&&(a.Agent.isiPhoneNative=!0,a.Agent.isMobileNative=!0)},c.prototype.testTablet=function(){var a=this;switch(!0){case a.Agent.isiPad:case a.Agent.isAndroidTablet:case a.Agent.isKindleFire:a.Agent.isTablet=!0}/tablet/i.test(a.Agent.source)&&(a.Agent.isTablet=!0)},c.prototype.testNginxGeoIP=function(a){var b=this;return Object.keys(a).forEach(function(c){/^GEOIP/i.test(c)&&(b.Agent.geoIp[c]=a[c])}),b},c.prototype.testBot=function(){var a=this,b=f.exec(a.Agent.source.toLowerCase());b?a.Agent.isBot=b[1]:a.Agent.isAuthoritative||(a.Agent.isBot=/bot/i.test(a.Agent.source))},c.prototype.testSmartTV=function(){var a=this;a.Agent.isSmartTV=new RegExp("smart-tv|smarttv|googletv|appletv|hbbtv|pov_tv|netcast.tv","gi").test(a.Agent.source.toLowerCase())},c.prototype.testAndroidTablet=function(){var a=this;a.Agent.isAndroid&&!/mobile/i.test(a.Agent.source)&&(a.Agent.isAndroidTablet=!0)},c.prototype.testWebkit=function(){var a=this;"unknown"===a.Agent.browser&&/applewebkit/i.test(a.Agent.source)&&(a.Agent.browser="Apple WebKit",a.Agent.isWebkit=!0)},c.prototype.testWechat=function(){var a=this;/micromessenger/i.test(a.Agent.source)&&(a.Agent.isWechat=!0,a.Agent.version=this.getWechatVersion(a.Agent.source))},c.prototype.testWebview=function(){var a=["iOS","OS X"].indexOf(this.Agent.os)!==-1||this.Agent.isiPad||this.Agent.isiPod||this.Agent.isiPhone;a&&d?window.navigator.standalone&&!this.Agent.isSafari?this.Agent.isiOSStandalone=!0:window.navigator.standalone||this.Agent.isSafari||(this.Agent.isiOSUiwebview=!0):this.Agent.isAndroid&&/; ?wv\)/i.test(this.Agent.source)&&(this.Agent.isAndroidWebview=!0)},c.prototype.parse=function(a){try{console.warn("The `userAgentInstance.parse` method from instance is deprecated, use the static method instead: `UserAgent.parse`.")}catch(b){}return c.parse(a)},c.parse=function(a){var b=new c(a);return b.Agent},c.testNginxGeoIP=function(a){return new c(null,a)},a.UserAgent=c}(this); \ No newline at end of file