Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ua-parser-js

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ua-parser-js - npm Package Compare versions

Comparing version 0.5.2 to 0.5.3

7

package.json
{
"title": "UA-Parser.JS",
"name": "ua-parser-js",
"version": "0.5.2",
"version": "0.5.3",
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",

@@ -17,3 +17,6 @@ "description": "Lightweight JavaScript-based user-agent string parser",

"contributors": [
"Faisal Salman <fyzlman@gmail.com>"
"Faisal Salman <fyzlman@gmail.com>",
"Christopher De Cairos <chris.decairos@gmail.com>",
"John Tantalo <john.tantalo@gmail.com>",
"Lee Treveil <leetreveil@gmail.com>"
],

@@ -20,0 +23,0 @@ "main": "ua-parser",

@@ -1,2 +0,2 @@

// UA-Parser.JS v0.5.2
// UA-Parser.JS v0.5.3
// Lightweight JavaScript-based User-Agent string parser

@@ -11,3 +11,3 @@ // https://github.com/faisalman/ua-parser-js

'use strict';
var EMPTY = '',

@@ -101,5 +101,5 @@ FUNC = 'function',

var maps = {
browser : {
oldsafari : {
browser : {
oldsafari : {
major : {

@@ -109,3 +109,3 @@ '1' : ['/85', '/125', '/312'],

'undefined' : '/'
},
},
version : {

@@ -123,4 +123,4 @@ '1.0' : '/85',

},
device : {
device : {
sprint : {

@@ -131,9 +131,10 @@ model : {

vendor : {
'HTC' : 'APA'
'HTC' : 'APA',
'Sprint' : 'Sprint'
}
}
},
os : {
windows : {
os : {
windows : {
version : {

@@ -175,28 +176,32 @@ 'ME' : '4.90',

// Webkit/KHTML based
/(rekonq)((?:\/)[\w\.]+)*/i, // Rekonq
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt)\/((\d+)?[\w\.-]+)/i
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt
], [NAME, VERSION, MAJOR], [
/(yabrowser)\/((\d+)?[\w\.]+)/i // Yandex
], [[NAME, 'Yandex'], VERSION, MAJOR], [
/(comodo_dragon)\/((\d+)?[\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION, MAJOR], [
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i
// Chrome/OmniWeb/Arora/Tizen/Nokia
], [NAME, VERSION, MAJOR], [
/(dolfin)\/((\d+)?[\w\.]+)/i // Dolphin
], [[NAME, 'Dolphin'], VERSION, MAJOR], [
/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i // Chrome for Android/iOS
], [[NAME, 'Chrome'], VERSION, MAJOR], [
/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
], [VERSION, MAJOR, [NAME, 'Mobile Safari']], [
/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile
], [VERSION, MAJOR, NAME], [
/applewebkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i // Safari < 3.0
], [NAME, [MAJOR, mapper.string, maps.browser.oldsafari.major], [VERSION, mapper.string, maps.browser.oldsafari.version]], [
/(konqueror)\/((\d+)?[\w\.]+)/i, // Konqueror

@@ -210,4 +215,4 @@ /(applewebkit|khtml)\/((\d+)?[\w\.]+)/i

/(swiftfox)/i, // Swiftfox
/(iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo)[\/\s]?((\d+)?[\w\.\+]+)/i,
// Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo
/(iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
// Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,

@@ -218,5 +223,7 @@ // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix

// Other
/(uc\s?browser|polaris|lynx|dillo|icab|doris)[\/\s]?((\d+)?[\w\.]+)/i,
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris
/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?((\d+)?[\w\.]+)/i,
// UCBrowser/Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf
/(links)\s\(((\d+)?[\w\.]+)/i, // Links
/(gobrowser)\/?((\d+)?[\w\.]+)*/i, // GoBrowser
/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, // ICE Browser
/(mosaic)[\/\s]((\d+)?[\w\.]+)/i // Mosaic

@@ -230,3 +237,3 @@ ], [NAME, VERSION, MAJOR]

], [MODEL, VENDOR, [TYPE, TABLET]], [
/(hp).+(touchpad)/i, // HP TouchPad

@@ -240,3 +247,3 @@ /(kindle)\/([\w\.]+)/i, // Kindle

], [MODEL, VENDOR, [TYPE, MOBILE]], [
/(blackberry)[\s-]?(\w+)/i, // BlackBerry

@@ -259,7 +266,7 @@ /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,

], [VENDOR, MODEL, [TYPE, CONSOLE]], [
/(sprint\s[a-z]+)(\w+)/i // Sprint Phones
/(sprint\s(\w+))/i // Sprint Phones
], [[VENDOR, mapper.string, maps.device.sprint.vendor], [MODEL, mapper.string, maps.device.sprint.model], [TYPE, MOBILE]], [
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
/(zte)-(\w+)*/i, // ZTE

@@ -296,3 +303,3 @@ /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|;\ssony)[_\s-]?([\w-]+)*/i

], [[VENDOR, 'LG'], MODEL, [TYPE, MOBILE]], [
/(mobile|tablet);.+rv\:.+gecko\//i // Unidentifiable

@@ -305,5 +312,7 @@ ], [TYPE, VENDOR, MODEL]

/(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront)\/([\w\.]+)/i, // WebKit/Trident/NetFront
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m
/(khtml)\/([\w\.]+)/i, // KHTML
/(tasman)\s([\w\.]+)/i // Tasman
/(tasman)\s([\w\.]+)/i, // Tasman
/(links)\s\(([\w\.]+)/i, // Links
/(icab)[\/\s]([2-3]\.[\d\.]+)/i // iCab
], [NAME, VERSION], [

@@ -368,5 +377,5 @@

/(haiku)\s(\w+)/i, // Haiku
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS
/(unix)\s?([\w\.]+)*/i // UNIX

@@ -373,0 +382,0 @@ ], [NAME, VERSION]

@@ -1,2 +0,2 @@

// UA-Parser.JS v0.5.2
// UA-Parser.JS v0.5.3
// Lightweight JavaScript-based User-Agent string parser

@@ -7,2 +7,2 @@ // https://github.com/faisalman/ua-parser-js

// Dual licensed under GPLv2 & MIT
(function(e,t){"use strict";var n="",r="function",i="undefined",s="object",o="major",u="model",a="name",f="type",l="vendor",c="version",h="console",p="mobile",d="tablet",v={regex:function(){var e,o,u,a,f,l,c=arguments;for(o=0;o<c.length;o+=2){var h=c[o],p=c[o+1];if(typeof e===i){e={};for(a=0;a<p.length;a++)typeof p[a]===s?e[p[a][0]]=t:e[p[a]]=t;if(this.getUA().toString()===n)return e}for(u=0;u<h.length;u++){f=h[u].exec(this.getUA());if(!!f){for(a=0;a<p.length;a++)l=f[a+1],typeof p[a]===s&&p[a].length===2?e[p[a][0]]=p[a][1]:typeof p[a]===s&&p[a].length===3?typeof p[a][1]===r&&(!p[a][1].exec||!p[a][1].test)?e[p[a][0]]=l?p[a][1].call(this,l,p[a][2]):t:e[p[a][0]]=l?l.replace(p[a][1],p[a][2]):t:e[p[a]]=l?l:t;break}}if(!!f)break}return e},string:function(e,n){for(var r in n)if(n.hasOwnProperty(r))if(typeof n[r]===s&&n[r].length>0){for(var o=0;o<n[r].length;o++)if(e.toLowerCase().indexOf(n[r][o].toLowerCase())!==-1)return r.toString()===i?t:r}else if(e.toLowerCase().indexOf(n[r].toLowerCase())!==-1)return r.toString()===i?t:r;return e}},m={browser:{oldsafari:{major:{1:["/85","/125","/312"],2:["/412","/416","/417","/419"],"undefined":"/"},version:{"1.0":"/85",1.2:"/125",1.3:"/312","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","undefined":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",RT:"ARM"}}}},g={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i,/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\sbrowser|iemobile|slimbrowser|baidubrowser)[\/\s]?((\d+)?[\w\.]*)/i,/ms(ie)\s((\d+)?[\w\.]+)/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt)\/((\d+)?[\w\.-]+)/i],[a,c,o],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[a,"Yandex"],c,o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],[a,c,o],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[a,"Dolphin"],c,o],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[a,"Chrome"],c,o],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[c,o,[a,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[c,o,a],[/applewebkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[a,[o,v.string,m.browser.oldsafari.major],[c,v.string,m.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(applewebkit|khtml)\/((\d+)?[\w\.]+)/i],[a,c,o],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[a,"Netscape"],c,o],[/(swiftfox)/i,/(iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(uc\s?browser|polaris|lynx|dillo|icab|doris)[\/\s]?((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[a,c,o]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,l,[f,d]],[/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[l,u,[f,d]],[/\((ip[honed]+);.+(apple)/i],[u,l,[f,p]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[l,u,[f,p]],[/\((bb10);\s(\w+)/i],[[l,"BlackBerry"],u,[f,p]],[/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],[[l,"Asus"],u,[f,d]],[/(sony)\s(tablet\s[ps])/i],[l,u,[f,d]],[/(nintendo|playstation)\s([wids3portablev]+)/i],[l,u,[f,h]],[/(sprint\s[a-z]+)(\w+)/i],[[l,v.string,m.device.sprint.vendor],[u,v.string,m.device.sprint.model],[f,p]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|;\ssony)[_\s-]?([\w-]+)*/i],[l,[u,/_/g," "],[f,p]],[/\s((milestone|droid[2x]?))[globa\s]*\sbuild\//i,/(mot)[\s-]?(\w+)*/i],[[l,"Motorola"],u,[f,p]],[/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],[[l,"Motorola"],u,[f,d]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],[[l,"Samsung"],u,[f,d]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[l,"Samsung"],u,[f,p]],[/(sie)-(\w+)*/i],[[l,"Siemens"],u,[f,p]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[l,"Nokia"],u,[f,p]],[/android\s3\.[\s\w-;]{10}((a\d{3}))/i],[[l,"Acer"],u,[f,d]],[/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],[[l,"LG"],u,[f,d]],[/(lg)[e;\s-\/]+(\w+)*/i],[[l,"LG"],u,[f,p]],[/(mobile|tablet);.+rv\:.+gecko\//i],[f,l,u]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront)\/([\w\.]+)/i,/(khtml)\/([\w\.]+)/i,/(tasman)\s([\w\.]+)/i],[a,c],[/rv\:([\w\.]+).*(gecko)/i],[c,a]],os:[[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone\sos|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[c,v.string,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[c,v.string,m.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],c],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)\/([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],[a,c],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[a,"Symbian"],c],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],c],[/(nintendo|playstation)\s([wids3portablev]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[a,c],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],c],[/(sunos)\s?([\w\.]+\d)*/i],[[a,"Solaris"],c],[/\s(\w*bsd|dragonfly)\s?([\w\.]+)*/i],[a,c],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[a,"iOS"],[c,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],[a,[c,/_/g,"."]],[/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos)/i,/(unix)\s?([\w\.]+)*/i],[a,c]]},y=function(r){var i=r||(e&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:n);this.getBrowser=function(){return v.regex.apply(this,g.browser)},this.getDevice=function(){return v.regex.apply(this,g.device)},this.getEngine=function(){return v.regex.apply(this,g.engine)},this.getOS=function(){return v.regex.apply(this,g.os)},this.getResult=function(){return{browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice()}},this.getUA=function(){return i},this.setUA=function(e){return i=e,this},this.setUA(i)};typeof exports!==i&&!/\[object\s[DOM]*Window\]/.test(e.toString())?(typeof module!==i&&module.exports&&(exports=module.exports=y),exports.UAParser=y):e.UAParser=y})(this);
(function(e,t){"use strict";var n="",r="function",i="undefined",s="object",o="major",u="model",a="name",f="type",l="vendor",c="version",h="console",p="mobile",d="tablet",v={regex:function(){var e,o,u,a,f,l,c=arguments;for(o=0;o<c.length;o+=2){var h=c[o],p=c[o+1];if(typeof e===i){e={};for(a=0;a<p.length;a++)typeof p[a]===s?e[p[a][0]]=t:e[p[a]]=t;if(this.getUA().toString()===n)return e}for(u=0;u<h.length;u++){f=h[u].exec(this.getUA());if(!!f){for(a=0;a<p.length;a++)l=f[a+1],typeof p[a]===s&&p[a].length===2?e[p[a][0]]=p[a][1]:typeof p[a]===s&&p[a].length===3?typeof p[a][1]===r&&(!p[a][1].exec||!p[a][1].test)?e[p[a][0]]=l?p[a][1].call(this,l,p[a][2]):t:e[p[a][0]]=l?l.replace(p[a][1],p[a][2]):t:e[p[a]]=l?l:t;break}}if(!!f)break}return e},string:function(e,n){for(var r in n)if(n.hasOwnProperty(r))if(typeof n[r]===s&&n[r].length>0){for(var o=0;o<n[r].length;o++)if(e.toLowerCase().indexOf(n[r][o].toLowerCase())!==-1)return r.toString()===i?t:r}else if(e.toLowerCase().indexOf(n[r].toLowerCase())!==-1)return r.toString()===i?t:r;return e}},m={browser:{oldsafari:{major:{1:["/85","/125","/312"],2:["/412","/416","/417","/419"],"undefined":"/"},version:{"1.0":"/85",1.2:"/125",1.3:"/312","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","undefined":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",RT:"ARM"}}}},g={browser:[[/(opera\smini)\/((\d+)?[\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i,/(opera).+version\/((\d+)?[\w\.]+)/i,/(opera)[\/\s]+((\d+)?[\w\.]+)/i,/(kindle)\/((\d+)?[\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,/(avant\sbrowser|iemobile|slimbrowser|baidubrowser)[\/\s]?((\d+)?[\w\.]*)/i,/ms(ie)\s((\d+)?[\w\.]+)/i,/(rekonq)((?:\/)[\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt)\/((\d+)?[\w\.-]+)/i],[a,c,o],[/(yabrowser)\/((\d+)?[\w\.]+)/i],[[a,"Yandex"],c,o],[/(comodo_dragon)\/((\d+)?[\w\.]+)/i],[[a,/_/g," "],c,o],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],[a,c,o],[/(dolfin)\/((\d+)?[\w\.]+)/i],[[a,"Dolphin"],c,o],[/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],[[a,"Chrome"],c,o],[/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],[c,o,[a,"Mobile Safari"]],[/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],[c,o,a],[/applewebkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],[a,[o,v.string,m.browser.oldsafari.major],[c,v.string,m.browser.oldsafari.version]],[/(konqueror)\/((\d+)?[\w\.]+)/i,/(applewebkit|khtml)\/((\d+)?[\w\.]+)/i],[a,c,o],[/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],[[a,"Netscape"],c,o],[/(swiftfox)/i,/(iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,/(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,/(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?((\d+)?[\w\.]+)/i,/(links)\s\(((\d+)?[\w\.]+)/i,/(gobrowser)\/?((\d+)?[\w\.]+)*/i,/(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,/(mosaic)[\/\s]((\d+)?[\w\.]+)/i],[a,c,o]],device:[[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],[u,l,[f,d]],[/(hp).+(touchpad)/i,/(kindle)\/([\w\.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d]*[\dko])/i],[l,u,[f,d]],[/\((ip[honed]+);.+(apple)/i],[u,l,[f,p]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[l,u,[f,p]],[/\((bb10);\s(\w+)/i],[[l,"BlackBerry"],u,[f,p]],[/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],[[l,"Asus"],u,[f,d]],[/(sony)\s(tablet\s[ps])/i],[l,u,[f,d]],[/(nintendo|playstation)\s([wids3portablev]+)/i],[l,u,[f,h]],[/(sprint\s(\w+))/i],[[l,v.string,m.device.sprint.vendor],[u,v.string,m.device.sprint.model],[f,p]],[/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i,/(zte)-(\w+)*/i,/(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|;\ssony)[_\s-]?([\w-]+)*/i],[l,[u,/_/g," "],[f,p]],[/\s((milestone|droid[2x]?))[globa\s]*\sbuild\//i,/(mot)[\s-]?(\w+)*/i],[[l,"Motorola"],u,[f,p]],[/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],[[l,"Motorola"],u,[f,d]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],[[l,"Samsung"],u,[f,d]],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i,/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,/sec-((sgh\w+))/i],[[l,"Samsung"],u,[f,p]],[/(sie)-(\w+)*/i],[[l,"Siemens"],u,[f,p]],[/(maemo|nokia).*(n900|lumia\s\d+)/i,/(nokia)[\s_-]?([\w-]+)*/i],[[l,"Nokia"],u,[f,p]],[/android\s3\.[\s\w-;]{10}((a\d{3}))/i],[[l,"Acer"],u,[f,d]],[/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],[[l,"LG"],u,[f,d]],[/(lg)[e;\s-\/]+(\w+)*/i],[[l,"LG"],u,[f,p]],[/(mobile|tablet);.+rv\:.+gecko\//i],[f,l,u]],engine:[[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml)\/([\w\.]+)/i,/(tasman)\s([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(icab)[\/\s]([2-3]\.[\d\.]+)/i],[a,c],[/rv\:([\w\.]+).*(gecko)/i],[c,a]],os:[[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone\sos|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[a,[c,v.string,m.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[a,"Windows"],[c,v.string,m.os.windows.version]],[/\((bb)(10);/i],[[a,"BlackBerry"],c],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)\/([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],[a,c],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[a,"Symbian"],c],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[a,"Firefox OS"],c],[/(nintendo|playstation)\s([wids3portablev]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[a,c],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[a,"Chromium OS"],c],[/(sunos)\s?([\w\.]+\d)*/i],[[a,"Solaris"],c],[/\s(\w*bsd|dragonfly)\s?([\w\.]+)*/i],[a,c],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[a,"iOS"],[c,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],[a,[c,/_/g,"."]],[/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,/(unix)\s?([\w\.]+)*/i],[a,c]]},y=function(r){var i=r||(e&&e.navigator&&e.navigator.userAgent?e.navigator.userAgent:n);this.getBrowser=function(){return v.regex.apply(this,g.browser)},this.getDevice=function(){return v.regex.apply(this,g.device)},this.getEngine=function(){return v.regex.apply(this,g.engine)},this.getOS=function(){return v.regex.apply(this,g.os)},this.getResult=function(){return{browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice()}},this.getUA=function(){return i},this.setUA=function(e){return i=e,this},this.setUA(i)};typeof exports!==i&&!/\[object\s[DOM]*Window\]/.test(e.toString())?(typeof module!==i&&module.exports&&(exports=module.exports=y),exports.UAParser=y):e.UAParser=y})(this);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc