mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
Merge from develop branch
This commit is contained in:
commit
a04d2c0efc
@ -1,6 +1,5 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- 0.8
|
|
||||||
- "0.10"
|
- "0.10"
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Faisal Salman <fyzlman@gmail.com>"
|
"Faisal Salman <fyzlman@gmail.com>"
|
||||||
],
|
],
|
||||||
|
@ -33,5 +33,5 @@ echo "Running test..."
|
|||||||
$MOCHA_DIR -R nyan test/test.js
|
$MOCHA_DIR -R nyan test/test.js
|
||||||
|
|
||||||
echo "Minifying script..."
|
echo "Minifying script..."
|
||||||
$UGLIFY_DIR src/ua-parser.js > src/ua-parser.min.js
|
$UGLIFY_DIR src/ua-parser.js > dist/ua-parser.min.js --comments '/UAParser\.js/'
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device", "cpu"],
|
"keywords": ["user-agent", "parser", "browser", "engine", "os", "device", "cpu"],
|
||||||
"scripts": ["src/ua-parser.js"],
|
"scripts": ["src/ua-parser.js"],
|
||||||
|
9
dist/ua-parser.min.js
vendored
Normal file
9
dist/ua-parser.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js",
|
"title": "UAParser.js",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@ -46,7 +46,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"jshint": "~1.1.0",
|
"jshint": "~1.1.0",
|
||||||
"mocha": "~1.7.1",
|
"mocha": "~1.8.0",
|
||||||
"uglify-js": "~1.3.4"
|
"uglify-js": "~1.3.4"
|
||||||
},
|
},
|
||||||
"repository" : {
|
"repository" : {
|
||||||
@ -67,7 +67,8 @@
|
|||||||
"node": "*"
|
"node": "*"
|
||||||
},
|
},
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "src",
|
"dist": "dist",
|
||||||
|
"src": "src",
|
||||||
"test": "test"
|
"test": "test"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
readme.md
22
readme.md
@ -38,12 +38,13 @@ Tizen, UCBrowser, w3m, Yandex
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Possible 'device.type':
|
# Possible 'device.type':
|
||||||
console, mobile, tablet, smarttv
|
console, mobile, tablet, smarttv, wearable, embedded
|
||||||
|
|
||||||
# Possible 'device.vendor':
|
# Possible 'device.vendor':
|
||||||
Acer, Alcatel, Amazon, Apple, Asus, BenQ, BlackBerry, Dell, GeeksPhone,
|
Acer, Alcatel, Amazon, Apple, Archos, Asus, BenQ, BlackBerry, Dell, GeeksPhone,
|
||||||
HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Motorola, Nexian, Nintendo, Nokia,
|
Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian,
|
||||||
Palm, Panasonic, Polytron, RIM, Samsung, Siemens, Sony-Ericsson, Sprint, ZTE
|
Nintendo, Nokia, Nvidia, Ouya, Palm, Panasonic, Polytron, RIM, Samsung, Sharp,
|
||||||
|
Siemens, Sony-Ericsson, Sprint, Xbox, ZTE
|
||||||
|
|
||||||
# 'device.model' determined dynamically
|
# 'device.model' determined dynamically
|
||||||
```
|
```
|
||||||
@ -64,12 +65,12 @@ Trident, w3m, WebKit
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Possible 'os.name'
|
# Possible 'os.name'
|
||||||
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
|
AIX, Amiga OS, Android, Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, Contiki,
|
||||||
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
|
Fedora, Firefox OS, FreeBSD, Debian, DragonFly, Gentoo, GNU, Haiku, Hurd, iOS,
|
||||||
Joli, Linux, Mac OS, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD, Nintendo,
|
Joli, Linpus, Linux, Mac OS, Mageia, Mandriva, MeeGo, Minix, Mint, Morph OS, NetBSD,
|
||||||
OpenBSD, OS/2, Palm, PCLinuxOS, Plan9, Playstation, QNX, RedHat, RIM Tablet OS,
|
Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PCLinuxOS, Plan9, Playstation, QNX, RedHat,
|
||||||
RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu,
|
RIM Tablet OS, RISC OS, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
|
||||||
UNIX, WebOS, Windows [Phone/Mobile], Zenwalk
|
Ubuntu, UNIX, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk
|
||||||
|
|
||||||
# 'os.version' determined dynamically
|
# 'os.version' determined dynamically
|
||||||
```
|
```
|
||||||
@ -79,7 +80,8 @@ UNIX, WebOS, Windows [Phone/Mobile], Zenwalk
|
|||||||
|
|
||||||
```
|
```
|
||||||
# Possible 'cpu.architecture'
|
# Possible 'cpu.architecture'
|
||||||
68k, amd64, arm, ia32, ia64, irix, irix64, mips, mips64, pa-risc, ppc, sparc, sparc64
|
68k, amd64, arm, arm64, avr, ia32, ia64, irix, irix64, mips, mips64, pa-risc,
|
||||||
|
ppc, sparc, sparc64
|
||||||
```
|
```
|
||||||
|
|
||||||
* `getResult()`
|
* `getResult()`
|
||||||
|
118
src/ua-parser.js
118
src/ua-parser.js
@ -1,9 +1,11 @@
|
|||||||
// UAParser.js v0.7.1
|
/**
|
||||||
// Lightweight JavaScript-based User-Agent string parser
|
* UAParser.js v0.7.2
|
||||||
// https://github.com/faisalman/ua-parser-js
|
* Lightweight JavaScript-based User-Agent string parser
|
||||||
//
|
* https://github.com/faisalman/ua-parser-js
|
||||||
// Copyright © 2012-2014 Faisal Salman <fyzlman@gmail.com>
|
*
|
||||||
// Dual licensed under GPLv2 & MIT
|
* Copyright © 2012-2014 Faisal Salman <fyzlman@gmail.com>
|
||||||
|
* Dual licensed under GPLv2 & MIT
|
||||||
|
*/
|
||||||
|
|
||||||
(function (window, undefined) {
|
(function (window, undefined) {
|
||||||
|
|
||||||
@ -14,7 +16,7 @@
|
|||||||
/////////////
|
/////////////
|
||||||
|
|
||||||
|
|
||||||
var LIBVERSION = '0.7.1',
|
var LIBVERSION = '0.7.2',
|
||||||
EMPTY = '',
|
EMPTY = '',
|
||||||
UNKNOWN = '?',
|
UNKNOWN = '?',
|
||||||
FUNC_TYPE = 'function',
|
FUNC_TYPE = 'function',
|
||||||
@ -30,7 +32,9 @@
|
|||||||
CONSOLE = 'console',
|
CONSOLE = 'console',
|
||||||
MOBILE = 'mobile',
|
MOBILE = 'mobile',
|
||||||
TABLET = 'tablet',
|
TABLET = 'tablet',
|
||||||
SMARTTV = 'smarttv';
|
SMARTTV = 'smarttv',
|
||||||
|
WEARABLE = 'wearable',
|
||||||
|
EMBEDDED = 'embedded';
|
||||||
|
|
||||||
|
|
||||||
///////////
|
///////////
|
||||||
@ -67,8 +71,10 @@
|
|||||||
|
|
||||||
rgx : function () {
|
rgx : function () {
|
||||||
|
|
||||||
|
var result, i = 0, j, k, p, q, matches, match, args = arguments;
|
||||||
|
|
||||||
// loop through all regexes maps
|
// loop through all regexes maps
|
||||||
for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) {
|
while (i < args.length && !matches) {
|
||||||
|
|
||||||
var regex = args[i], // even sequence (0,2,4,..)
|
var regex = args[i], // even sequence (0,2,4,..)
|
||||||
props = args[i + 1]; // odd sequence (1,3,5,..)
|
props = args[i + 1]; // odd sequence (1,3,5,..)
|
||||||
@ -87,8 +93,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// try matching uastring with regexes
|
// try matching uastring with regexes
|
||||||
for (j = k = 0; j < regex.length; j++) {
|
j = k = 0;
|
||||||
matches = regex[j].exec(this.getUA());
|
while (j < regex.length && !matches) {
|
||||||
|
matches = regex[j++].exec(this.getUA());
|
||||||
if (!!matches) {
|
if (!!matches) {
|
||||||
for (p = 0; p < props.length; p++) {
|
for (p = 0; p < props.length; p++) {
|
||||||
match = matches[++k];
|
match = matches[++k];
|
||||||
@ -119,11 +126,9 @@
|
|||||||
result[q] = match ? match : undefined;
|
result[q] = match ? match : undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
i += 2;
|
||||||
if(!!matches) break; // break the loop immediately if match found
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
@ -203,6 +208,7 @@
|
|||||||
'7' : 'NT 6.1',
|
'7' : 'NT 6.1',
|
||||||
'8' : 'NT 6.2',
|
'8' : 'NT 6.2',
|
||||||
'8.1' : 'NT 6.3',
|
'8.1' : 'NT 6.3',
|
||||||
|
'10' : 'NT 6.4',
|
||||||
'RT' : 'ARM'
|
'RT' : 'ARM'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -432,8 +438,8 @@
|
|||||||
/(sun4\w)[;\)]/i // SPARC
|
/(sun4\w)[;\)]/i // SPARC
|
||||||
], [[ARCHITECTURE, 'sparc']], [
|
], [[ARCHITECTURE, 'sparc']], [
|
||||||
|
|
||||||
/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
|
/((?:avr32|ia64(?=;))|68k(?=\))|arm(?:64|(?=v\d+;))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i
|
||||||
// IA64, 68K, ARM, IRIX, MIPS, SPARC, PA-RISC
|
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
|
||||||
], [[ARCHITECTURE, util.lowerize]]
|
], [[ARCHITECTURE, util.lowerize]]
|
||||||
],
|
],
|
||||||
|
|
||||||
@ -448,6 +454,7 @@
|
|||||||
/(apple\s{0,1}tv)/i // Apple TV
|
/(apple\s{0,1}tv)/i // Apple TV
|
||||||
], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [
|
], [[MODEL, 'Apple TV'], [VENDOR, 'Apple']], [
|
||||||
|
|
||||||
|
/(archos)\s(gamepad2?)/i, // Archos
|
||||||
/(hp).+(touchpad)/i, // HP TouchPad
|
/(hp).+(touchpad)/i, // HP TouchPad
|
||||||
/(kindle)\/([\w\.]+)/i, // Kindle
|
/(kindle)\/([\w\.]+)/i, // Kindle
|
||||||
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
|
/\s(nook)[\w\s]+build\/(\w+)/i, // Nook
|
||||||
@ -470,26 +477,30 @@
|
|||||||
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
|
/(hp)\s([\w\s]+\w)/i, // HP iPAQ
|
||||||
/(asus)-?(\w+)/i // Asus
|
/(asus)-?(\w+)/i // Asus
|
||||||
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
||||||
/\((bb10);\s(\w+)/i // BlackBerry 10
|
/\(bb10;\s(\w+)/i // BlackBerry 10
|
||||||
], [[VENDOR, 'BlackBerry'], MODEL, [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'BlackBerry'], [TYPE, MOBILE]], [
|
||||||
// Asus Tablets
|
// Asus Tablets
|
||||||
/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7))/i
|
/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7)/i
|
||||||
], [[VENDOR, 'Asus'], MODEL, [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Asus'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
/(sony)\s(tablet\s[ps])/i // Sony Tablets
|
/(sony)\s(tablet\s[ps])/i // Sony Tablets
|
||||||
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
|
/\s(ouya)\s/i, // Ouya
|
||||||
/(nintendo)\s([wids3u]+)/i // Nintendo
|
/(nintendo)\s([wids3u]+)/i // Nintendo
|
||||||
], [VENDOR, MODEL, [TYPE, CONSOLE]], [
|
], [VENDOR, MODEL, [TYPE, CONSOLE]], [
|
||||||
|
|
||||||
/((playstation)\s[3portablevi]+)/i // Playstation
|
/android.+;\s(shield)\sbuild/i // Nvidia
|
||||||
], [[VENDOR, 'Sony'], MODEL, [TYPE, CONSOLE]], [
|
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [
|
||||||
|
|
||||||
|
/(playstation\s[3portablevi]+)/i // Playstation
|
||||||
|
], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [
|
||||||
|
|
||||||
/(sprint\s(\w+))/i // Sprint Phones
|
/(sprint\s(\w+))/i // Sprint Phones
|
||||||
], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [
|
], [[VENDOR, mapper.str, maps.device.sprint.vendor], [MODEL, mapper.str, maps.device.sprint.model], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/(Lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets
|
/(lenovo)\s?(S(?:5000|6000)+(?:[-][\w+]))/i // Lenovo tablets
|
||||||
], [[VENDOR, 'Lenovo'], MODEL, [TYPE, TABLET]], [
|
], [VENDOR, MODEL, [TYPE, TABLET]], [
|
||||||
|
|
||||||
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
|
/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, // HTC
|
||||||
/(zte)-(\w+)*/i, // ZTE
|
/(zte)-(\w+)*/i, // ZTE
|
||||||
@ -497,12 +508,17 @@
|
|||||||
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
|
// Alcatel/GeeksPhone/Huawei/Lenovo/Nexian/Panasonic/Sony
|
||||||
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
], [VENDOR, [MODEL, /_/g, ' '], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/[\s\(;](xbox(?:\sone)?)[\s\);]/i // Microsoft Xbox
|
||||||
|
], [MODEL, [VENDOR, 'Microsoft'], [TYPE, CONSOLE]], [
|
||||||
|
/(kin\.[onetw]{3})/i // Microsoft Kin
|
||||||
|
], [[MODEL, /\./g, ' '], [VENDOR, 'Microsoft'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
// Motorola
|
// Motorola
|
||||||
/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
|
/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i,
|
||||||
/(mot)[\s-]?(\w+)*/i
|
/(mot)[\s-]?(\w+)*/i
|
||||||
], [[VENDOR, 'Motorola'], MODEL, [TYPE, MOBILE]], [
|
], [[VENDOR, 'Motorola'], MODEL, [TYPE, MOBILE]], [
|
||||||
/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i
|
/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i
|
||||||
], [[VENDOR, 'Motorola'], MODEL, [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,
|
/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9|nexus 10))/i,
|
||||||
/((SM-T\w+))/i
|
/((SM-T\w+))/i
|
||||||
@ -511,30 +527,40 @@
|
|||||||
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
|
/(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i,
|
||||||
/sec-((sgh\w+))/i
|
/sec-((sgh\w+))/i
|
||||||
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
|
], [[VENDOR, 'Samsung'], MODEL, [TYPE, MOBILE]], [
|
||||||
/(sie)-(\w+)*/i // Siemens
|
/(samsung);smarttv/i
|
||||||
], [[VENDOR, 'Siemens'], MODEL, [TYPE, MOBILE]], [
|
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
|
||||||
|
/\(dtv[\);].+(aquos)/i // Sharp
|
||||||
|
], [MODEL, [VENDOR, 'Sharp'], [TYPE, SMARTTV]], [
|
||||||
|
/sie-(\w+)*/i // Siemens
|
||||||
|
], [MODEL, [VENDOR, 'Siemens'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
|
/(maemo|nokia).*(n900|lumia\s\d+)/i, // Nokia
|
||||||
/(nokia)[\s_-]?([\w-]+)*/i
|
/(nokia)[\s_-]?([\w-]+)*/i
|
||||||
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
|
], [[VENDOR, 'Nokia'], MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/android\s3\.[\s\w-;]{10}((a\d{3}))/i // Acer
|
/android\s3\.[\s\w-;]{10}(a\d{3})/i // Acer
|
||||||
], [[VENDOR, 'Acer'], MODEL, [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Acer'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
|
/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i // LG Tablet
|
||||||
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
|
], [[VENDOR, 'LG'], MODEL, [TYPE, TABLET]], [
|
||||||
/(lg) netcast\.tv/i // LG SmartTV
|
/(lg) netcast\.tv/i // LG SmartTV
|
||||||
], [VENDOR, [TYPE, SMARTTV]], [
|
], [VENDOR, MODEL, [TYPE, SMARTTV]], [
|
||||||
/((nexus\s[45]))/i, // LG
|
/(nexus\s[45])/i, // LG
|
||||||
/(lg)[e;\s\/-]+(\w+)*/i
|
/lg[e;\s\/-]+(\w+)*/i
|
||||||
], [[VENDOR, 'LG'], MODEL, [TYPE, MOBILE]], [
|
], [MODEL, [VENDOR, 'LG'], [TYPE, MOBILE]], [
|
||||||
|
|
||||||
/android.+((ideatab[a-z0-9\-\s]+))/i // Lenovo
|
/android.+(ideatab[a-z0-9\-\s]+)/i // Lenovo
|
||||||
], [[VENDOR, 'Lenovo'], MODEL, [TYPE, TABLET]], [
|
], [MODEL, [VENDOR, 'Lenovo'], [TYPE, TABLET]], [
|
||||||
|
|
||||||
/linux;.+((jolla));/i // Jolla
|
/linux;.+((jolla));/i // Jolla
|
||||||
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
], [VENDOR, MODEL, [TYPE, MOBILE]], [
|
||||||
|
|
||||||
|
/((pebble))app\/[\d\.]+\s/i // Pebble
|
||||||
|
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
|
||||||
|
|
||||||
|
/android.+;\s(glass)\s\d/i // Google Glass
|
||||||
|
], [MODEL, [VENDOR, 'Google'], [TYPE, WEARABLE]], [
|
||||||
|
|
||||||
/(mobile|tablet);.+rv\:.+gecko\//i // Unidentifiable
|
/(mobile|tablet);.+rv\:.+gecko\//i // Unidentifiable
|
||||||
], [[TYPE, util.lowerize], VENDOR, MODEL]
|
], [[TYPE, util.lowerize], VENDOR, MODEL]
|
||||||
],
|
],
|
||||||
@ -566,9 +592,9 @@
|
|||||||
/\((bb)(10);/i // BlackBerry 10
|
/\((bb)(10);/i // BlackBerry 10
|
||||||
], [[NAME, 'BlackBerry'], VERSION], [
|
], [[NAME, 'BlackBerry'], VERSION], [
|
||||||
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
|
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
|
||||||
/(tizen)\/([\w\.]+)/i, // Tizen
|
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
|
||||||
/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i,
|
/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
|
||||||
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo
|
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
|
||||||
/linux;.+(sailfish);/i // Sailfish OS
|
/linux;.+(sailfish);/i // Sailfish OS
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
|
/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian
|
||||||
@ -583,9 +609,10 @@
|
|||||||
|
|
||||||
// GNU/Linux based
|
// GNU/Linux based
|
||||||
/(mint)[\/\s\(]?(\w+)*/i, // Mint
|
/(mint)[\/\s\(]?(\w+)*/i, // Mint
|
||||||
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
|
/(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux
|
||||||
|
/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,
|
||||||
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
|
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
|
||||||
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk
|
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
|
||||||
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
|
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
|
||||||
/(gnu)\s?([\w\.]+)*/i // GNU
|
/(gnu)\s?([\w\.]+)*/i // GNU
|
||||||
], [NAME, VERSION], [
|
], [NAME, VERSION], [
|
||||||
@ -608,10 +635,11 @@
|
|||||||
], [NAME, [VERSION, /_/g, '.']], [
|
], [NAME, [VERSION, /_/g, '.']], [
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris
|
||||||
/(haiku)\s(\w+)/i, // Haiku
|
/(haiku)\s(\w+)/i, // Haiku
|
||||||
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
|
/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX
|
||||||
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i,
|
/(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,
|
||||||
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS
|
// Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS
|
||||||
/(unix)\s?([\w\.]+)*/i // UNIX
|
/(unix)\s?([\w\.]+)*/i // UNIX
|
||||||
], [NAME, VERSION]
|
], [NAME, VERSION]
|
||||||
]
|
]
|
||||||
@ -683,7 +711,9 @@
|
|||||||
CONSOLE : CONSOLE,
|
CONSOLE : CONSOLE,
|
||||||
MOBILE : MOBILE,
|
MOBILE : MOBILE,
|
||||||
SMARTTV : SMARTTV,
|
SMARTTV : SMARTTV,
|
||||||
TABLET : TABLET
|
TABLET : TABLET,
|
||||||
|
WEARABLE: WEARABLE,
|
||||||
|
EMBEDDED: EMBEDDED
|
||||||
};
|
};
|
||||||
UAParser.ENGINE = {
|
UAParser.ENGINE = {
|
||||||
NAME : NAME,
|
NAME : NAME,
|
||||||
|
1
src/ua-parser.min.js
vendored
1
src/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"title": "UAParser.js",
|
"title": "UAParser.js",
|
||||||
"name": "ua-parser-js",
|
"name": "ua-parser-js",
|
||||||
"version": "0.7.1",
|
"version": "0.7.2",
|
||||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"user-agent",
|
"user-agent",
|
||||||
@ -28,5 +28,5 @@
|
|||||||
],
|
],
|
||||||
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
"bugs": "https://github.com/faisalman/ua-parser-js/issues",
|
||||||
"docs": "https://github.com/faisalman/ua-parser-js",
|
"docs": "https://github.com/faisalman/ua-parser-js",
|
||||||
"download": "https://raw.github.com/faisalman/ua-parser-js/master/src/ua-parser.min.js"
|
"download": "https://raw.github.com/faisalman/ua-parser-js/master/dist/ua-parser.min.js"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user