mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-09-27 07:58:45 +03:00
update latest version
This commit is contained in:
parent
b1aef9db65
commit
0e35c2bbb0
BIN
images/over9000.jpg
Normal file
BIN
images/over9000.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 115 KiB |
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* UAParser.js v0.7.8
|
||||
* 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.8',
|
||||
var LIBVERSION = '0.7.10',
|
||||
EMPTY = '',
|
||||
UNKNOWN = '?',
|
||||
FUNC_TYPE = 'function',
|
||||
@ -89,11 +89,13 @@
|
||||
if (typeof result === UNDEF_TYPE) {
|
||||
result = {};
|
||||
for (p in props) {
|
||||
q = props[p];
|
||||
if (typeof q === OBJ_TYPE) {
|
||||
result[q[0]] = undefined;
|
||||
} else {
|
||||
result[q] = undefined;
|
||||
if (props.hasOwnProperty(p)){
|
||||
q = props[p];
|
||||
if (typeof q === OBJ_TYPE) {
|
||||
result[q[0]] = undefined;
|
||||
} else {
|
||||
result[q] = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -249,14 +251,16 @@
|
||||
|
||||
// Webkit/KHTML based
|
||||
/(rekonq)\/([\w\.]+)*/i, // Rekonq
|
||||
/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i
|
||||
// Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron
|
||||
/(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
|
||||
/(Edge)\/((\d+)?[\w\.]+)/i // IE12
|
||||
/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11
|
||||
], [[NAME, 'IE'], VERSION], [
|
||||
|
||||
/(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge
|
||||
], [NAME, VERSION], [
|
||||
|
||||
/(yabrowser)\/([\w\.]+)/i // Yandex
|
||||
], [[NAME, 'Yandex'], VERSION], [
|
||||
|
||||
@ -265,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], [
|
||||
|
||||
@ -284,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']], [
|
||||
|
||||
@ -308,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
|
||||
@ -507,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
|
||||
@ -533,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]], [
|
||||
@ -585,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]
|
||||
|
||||
/*//////////////////////////
|
||||
@ -682,7 +697,7 @@
|
||||
], [[NAME, 'BlackBerry'], VERSION], [
|
||||
/(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry
|
||||
/(tizen)[\/\s]([\w\.]+)/i, // Tizen
|
||||
/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
|
||||
/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,
|
||||
// Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki
|
||||
/linux;.+(sailfish);/i // Sailfish OS
|
||||
], [NAME, VERSION], [
|
||||
@ -694,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
|
||||
@ -717,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,
|
||||
@ -863,4 +878,4 @@
|
||||
};
|
||||
}
|
||||
|
||||
})(this);
|
||||
})(typeof window === 'object' ? window : this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user