mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-16 23:21:52 +03:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd39be3336 | ||
|
|
a1293f804e | ||
|
|
cf5c1f9e01 | ||
|
|
5d3835ad00 | ||
|
|
09bf4ecf7f | ||
|
|
43b0ee79d6 | ||
|
|
9518833e83 | ||
|
|
1e58e884ef | ||
|
|
e230cc1920 | ||
|
|
bbd3f14cfb | ||
|
|
a66d9b238a | ||
|
|
ae5bfb3893 | ||
|
|
e944fededb | ||
|
|
23160c9fb3 | ||
|
|
01ba36c94d | ||
|
|
99c15dee95 | ||
|
|
e8bec7e611 | ||
|
|
f670224d8e | ||
|
|
116b5c695d | ||
|
|
0aafba67fa | ||
|
|
ab6a56d931 | ||
|
|
3bff4cf037 | ||
|
|
3964971c38 | ||
|
|
3382b75cad | ||
|
|
a19c6be712 | ||
|
|
20ea67ed1d | ||
|
|
172d63a28f | ||
|
|
8e169098b5 | ||
|
|
aa1bf53337 | ||
|
|
22e17fb004 |
@@ -1,5 +1,13 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- stable
|
||||
- "0.10"
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- node_modules
|
||||
|
||||
sudo: false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.7.9",
|
||||
"version": "0.7.10",
|
||||
"authors": [
|
||||
"Faisal Salman <fyzlman@gmail.com>"
|
||||
],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.7.9",
|
||||
"version": "0.7.10",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": [
|
||||
"user-agent",
|
||||
|
||||
5
dist/ua-parser.min.js
vendored
5
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
5
dist/ua-parser.pack.js
vendored
5
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,12 +1,11 @@
|
||||
Package.describe({
|
||||
name: 'faisalman:ua-parser-js',
|
||||
version: '0.7.9',
|
||||
version: '0.7.10',
|
||||
summary: 'Lightweight JavaScript-based user-agent string parser',
|
||||
git: 'https://github.com/faisalman/ua-parser-js.git',
|
||||
documentation: 'readme.md'
|
||||
});
|
||||
|
||||
Package.on_use(function (api) {
|
||||
api.export("UAParser");
|
||||
api.addFiles("src/ua-parser.js");
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UAParser.js",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.7.9",
|
||||
"version": "0.7.10",
|
||||
"author": "Faisal Salman <fyzlman@gmail.com> (http://faisalman.com)",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": [
|
||||
|
||||
@@ -28,8 +28,8 @@ Firebird, Firefox, Flock, GoBrowser, iCab, ICE Browser, IceApe, IceCat, IceDrago
|
||||
Iceweasel, IE [Mobile], Iron, Jasmine, K-Meleon, Konqueror, Kindle, Links,
|
||||
Lunascape, Lynx, Maemo, Maxthon, Midori, Minimo, MIUI Browser, [Mobile] Safari,
|
||||
Mosaic, Mozilla, Netfront, Netscape, NetSurf, Nokia, OmniWeb, Opera [Mini/Mobi/Tablet],
|
||||
Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser, Swiftfox,
|
||||
Tizen, UCBrowser, Vivaldi, w3m, Yandex
|
||||
PhantomJS, Phoenix, Polaris, QQBrowser, RockMelt, Silk, Skyfire, SeaMonkey, SlimBrowser,
|
||||
Swiftfox, Tizen, UCBrowser, Vivaldi, w3m, Yandex
|
||||
|
||||
# 'browser.version' determined dynamically
|
||||
```
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* UAParser.js v0.7.9
|
||||
* UAParser.js v0.7.10
|
||||
* Lightweight JavaScript-based User-Agent string parser
|
||||
* https://github.com/faisalman/ua-parser-js
|
||||
*
|
||||
@@ -16,7 +16,7 @@
|
||||
/////////////
|
||||
|
||||
|
||||
var LIBVERSION = '0.7.9',
|
||||
var LIBVERSION = '0.7.10',
|
||||
EMPTY = '',
|
||||
UNKNOWN = '?',
|
||||
FUNC_TYPE = 'function',
|
||||
@@ -89,6 +89,7 @@
|
||||
if (typeof result === UNDEF_TYPE) {
|
||||
result = {};
|
||||
for (p in props) {
|
||||
if (props.hasOwnProperty(p)){
|
||||
q = props[p];
|
||||
if (typeof q === OBJ_TYPE) {
|
||||
result[q[0]] = undefined;
|
||||
@@ -97,6 +98,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// try matching uastring with regexes
|
||||
j = k = 0;
|
||||
@@ -249,8 +251,8 @@
|
||||
|
||||
// Webkit/KHTML based
|
||||
/(rekonq)\/([\w\.]+)*/i, // Rekonq
|
||||
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium)\/([\w\.-]+)/i
|
||||
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium
|
||||
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs)\/([\w\.-]+)/i
|
||||
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS
|
||||
], [NAME, VERSION], [
|
||||
|
||||
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
|
||||
@@ -267,10 +269,16 @@
|
||||
|
||||
/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,
|
||||
// Chrome/OmniWeb/Arora/Tizen/Nokia
|
||||
/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i
|
||||
// UCBrowser/QQBrowser
|
||||
/(qqbrowser)[\/\s]?([\w\.]+)/i
|
||||
// QQBrowser
|
||||
], [NAME, VERSION], [
|
||||
|
||||
/(uc\s?browser)[\/\s]?([\w\.]+)/i,
|
||||
/ucweb.+(ucbrowser)[\/\s]?([\w\.]+)/i,
|
||||
/JUC.+(ucweb)[\/\s]?([\w\.]+)/i
|
||||
// UCBrowser
|
||||
], [[NAME, 'UCBrowser'], VERSION], [
|
||||
|
||||
/(dolfin)\/([\w\.]+)/i // Dolphin
|
||||
], [[NAME, 'Dolphin'], VERSION], [
|
||||
|
||||
@@ -286,6 +294,9 @@
|
||||
/FBAV\/([\w\.]+);/i // Facebook App for iOS
|
||||
], [VERSION, [NAME, 'Facebook']], [
|
||||
|
||||
/fxios\/([\w\.-]+)/i // Firefox for iOS
|
||||
], [VERSION, [NAME, 'Firefox']], [
|
||||
|
||||
/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari
|
||||
], [VERSION, [NAME, 'Mobile Safari']], [
|
||||
|
||||
@@ -302,8 +313,6 @@
|
||||
// Gecko based
|
||||
/(navigator|netscape)\/([\w\.-]+)/i // Netscape
|
||||
], [[NAME, 'Netscape'], VERSION], [
|
||||
/fxios\/([\w\.-]+)/i // Firefox for iOS
|
||||
], [VERSION, [NAME, 'Firefox']], [
|
||||
/(swiftfox)/i, // Swiftfox
|
||||
/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,
|
||||
// IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror
|
||||
@@ -312,8 +321,8 @@
|
||||
/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla
|
||||
|
||||
// Other
|
||||
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,
|
||||
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf
|
||||
/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w\.]+)/i,
|
||||
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir
|
||||
/(links)\s\(([\w\.]+)/i, // Links
|
||||
/(gobrowser)\/?([\w\.]+)*/i, // GoBrowser
|
||||
/(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser
|
||||
@@ -511,7 +520,7 @@
|
||||
/android.+;\s(shield)\sbuild/i // Nvidia
|
||||
], [MODEL, [VENDOR, 'Nvidia'], [TYPE, CONSOLE]], [
|
||||
|
||||
/(playstation\s[3portablevi]+)/i // Playstation
|
||||
/(playstation\s[34portablevi]+)/i // Playstation
|
||||
], [MODEL, [VENDOR, 'Sony'], [TYPE, CONSOLE]], [
|
||||
|
||||
/(sprint\s(\w+))/i // Sprint Phones
|
||||
@@ -537,7 +546,8 @@
|
||||
// Motorola
|
||||
/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?)[\w\s]+build\//i,
|
||||
/mot[\s-]?(\w+)*/i,
|
||||
/(XT\d{3,4}) build\//i
|
||||
/(XT\d{3,4}) build\//i,
|
||||
/(nexus\s[6])/i
|
||||
], [MODEL, [VENDOR, 'Motorola'], [TYPE, MOBILE]], [
|
||||
/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i
|
||||
], [MODEL, [VENDOR, 'Motorola'], [TYPE, TABLET]], [
|
||||
@@ -589,7 +599,8 @@
|
||||
/android.+(mi[\s\-_]*(?:one|one[\s_]plus)?[\s_]*(?:\d\w)?)\s+build/i // Xiaomi Mi
|
||||
], [[MODEL, /_/g, ' '], [VENDOR, 'Xiaomi'], [TYPE, MOBILE]], [
|
||||
|
||||
/(mobile|tablet);.+rv\:.+gecko\//i // Unidentifiable
|
||||
/\s(tablet)[;\/\s]/i, // Unidentifiable Tablet
|
||||
/\s(mobile)[;\/\s]/i // Unidentifiable Mobile
|
||||
], [[TYPE, util.lowerize], VENDOR, MODEL]
|
||||
|
||||
/*//////////////////////////
|
||||
@@ -698,12 +709,12 @@
|
||||
], [[NAME, 'Firefox OS'], VERSION], [
|
||||
|
||||
// Console
|
||||
/(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation
|
||||
/(nintendo|playstation)\s([wids34portablevu]+)/i, // Nintendo/Playstation
|
||||
|
||||
// GNU/Linux based
|
||||
/(mint)[\/\s\(]?(\w+)*/i, // Mint
|
||||
/(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|[kxln]?ubuntu|debian|[open]*suse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,
|
||||
// Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware
|
||||
// Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus
|
||||
/(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux
|
||||
@@ -721,7 +732,7 @@
|
||||
/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly
|
||||
], [NAME, VERSION],[
|
||||
|
||||
/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS
|
||||
/(ip[honead]+)(?:.*os\s([\w]+)*\slike\smac|;\sopera)/i // iOS
|
||||
], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [
|
||||
|
||||
/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,
|
||||
|
||||
@@ -539,6 +539,16 @@
|
||||
"major" : "11"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "PhantomJS",
|
||||
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.2 Safari/534.34",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "PhantomJS",
|
||||
"version" : "1.9.2",
|
||||
"major" : "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Phoenix",
|
||||
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021029 Phoenix/0.4",
|
||||
@@ -664,11 +674,31 @@
|
||||
"ua" : "Mozilla/5.0 (S60V3; U; en-in; NokiaN73)/UC Browser8.4.0.159/28/351/UCWEB Mobile",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "UC Browser",
|
||||
"name" : "UCBrowser",
|
||||
"version" : "8.4.0.159",
|
||||
"major" : "8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "UC Browser J2ME",
|
||||
"ua" : "UCWEB/2.0 (MIDP-2.0; U; zh-CN; HTC EVO 3D X515m) U2/1.0.0 UCBrowser/10.4.0.558 U2/1.0.0 Mobile",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "UCBrowser",
|
||||
"version" : "10.4.0.558",
|
||||
"major" : "10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "UC Browser J2ME 2",
|
||||
"ua" : "JUC (Linux; U; 2.3.5; zh-cn; GT-I9100; 480*800) UCWEB7.9.0.94/139/800",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "UCBrowser",
|
||||
"version" : "7.9.0.94",
|
||||
"major" : "7"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Vivaldi",
|
||||
"ua" : "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.89 Vivaldi/1.0.83.38 Safari/537.36",
|
||||
@@ -708,5 +738,15 @@
|
||||
"version" : "43.8",
|
||||
"major" : "43"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Firefox iOS",
|
||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) FxiOS/1.1 Mobile/13B143 Safari/601.1.46",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Firefox",
|
||||
"version" : "1.1",
|
||||
"major" : "1"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -39,6 +39,16 @@
|
||||
"type" : "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Motorola Nexus 6",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.20 Mobile Safari/537.36",
|
||||
"expect" :
|
||||
{
|
||||
"vendor" : "Motorola",
|
||||
"model" : "Nexus 6",
|
||||
"type" : "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Motorola Droid RAZR 4G",
|
||||
"ua" : "Mozilla/5.0 (Linux; U; Android 2.3; xx-xx; DROID RAZR 4G Build/6.5.1-73_DHD-11_M1-29) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",
|
||||
@@ -238,5 +248,25 @@
|
||||
"model" : "MI-ONE Plus",
|
||||
"type" : "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "PlayStation 4",
|
||||
"ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)",
|
||||
"expect" :
|
||||
{
|
||||
"vendor" : "Sony",
|
||||
"model" : "PlayStation 4",
|
||||
"type" : "console"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Galaxy Nexus",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19",
|
||||
"expect" :
|
||||
{
|
||||
"vendor" : "Samsung",
|
||||
"model" : "Galaxy Nexus",
|
||||
"type" : "mobile"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -251,6 +251,15 @@
|
||||
"version" : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "PlayStation 4",
|
||||
"ua" : "Mozilla/5.0 (PlayStation 4 3.00) AppleWebKit/537.73 (KHTML, like Gecko)",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "PlayStation",
|
||||
"version" : "4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Mint",
|
||||
"ua" : "",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UAParser.js",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.7.9",
|
||||
"version": "0.7.10",
|
||||
"description": "Lightweight JavaScript-based user-agent string parser",
|
||||
"keywords": [
|
||||
"user-agent",
|
||||
|
||||
Reference in New Issue
Block a user