Merge tag '0.7.33' of github.com:faisalman/ua-parser-js into merge-original-0.7.33

This commit is contained in:
Kevin You 2023-03-16 22:17:07 -05:00
commit 2eb1fd8a66
12 changed files with 325 additions and 67 deletions

View File

@ -2,6 +2,9 @@ name: ua-parser-js-run-test
on: [push, pull_request] on: [push, pull_request]
permissions:
contents: read
jobs: jobs:
run-test: run-test:
runs-on: ubuntu-latest runs-on: ubuntu-latest

View File

@ -1,6 +1,6 @@
{ {
"name": "ua-parser-js", "name": "ua-parser-js",
"version": "0.7.31", "version": "0.7.33",
"authors": [ "authors": [
"Faisal Salman <f@faisalman.com>" "Faisal Salman <f@faisalman.com>"
], ],

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
Package.describe({ Package.describe({
name: 'faisalman:ua-parser-js', name: 'faisalman:ua-parser-js',
version: '0.7.31', version: '0.7.33',
summary: 'Lightweight JavaScript-based user-agent string parser', summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git', git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md' documentation: 'readme.md'

View File

@ -1,7 +1,7 @@
{ {
"title": "UAParser.js", "title": "UAParser.js",
"name": "@amplitude/ua-parser-js", "name": "@amplitude/ua-parser-js",
"version": "0.7.31", "version": "0.7.33",
"author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)", "author": "Faisal Salman <f@faisalman.com> (http://faisalman.com)",
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment", "description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment",
"keywords": [ "keywords": [
@ -141,6 +141,10 @@
"Zach Bjornson <zbbjornson@gmail.com>" "Zach Bjornson <zbbjornson@gmail.com>"
], ],
"main": "src/ua-parser.js", "main": "src/ua-parser.js",
"files": [
"dist",
"src"
],
"scripts": { "scripts": {
"build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle", "build": "uglifyjs src/ua-parser.js -o dist/ua-parser.min.js --comments '/^ UA/' && uglifyjs src/ua-parser.js -o dist/ua-parser.pack.js --comments '/^ UA/' --compress --mangle",
"test": "jshint src/ua-parser.js && mocha -R nyan test/test.js", "test": "jshint src/ua-parser.js && mocha -R nyan test/test.js",

View File

@ -19,17 +19,60 @@ JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model fro
* Source : https://github.com/faisalman/ua-parser-js * Source : https://github.com/faisalman/ua-parser-js
# Documentation # Documentation
### UAParser([user-agent][,extensions])
typeof `user-agent` "string".
typeof `extensions` "array".
In The Browser environment you dont need to pass the user-agent string to the function, you can just call the funtion and it should automatically get the string from the `window.navigator.userAgent`, but that is not the case in nodejs. The user-agent string must be passed in nodejs for the function to work.
Usually you can find the user agent in:
`request.headers["user-agent"]`.
## Constructor ## Constructor
When you call `UAParser` with the `new` keyword `UAParser` will return a new instance with an empty result object, you have to call one of the available methods to get the information from the user-agent string.
Like so:
* `new UAParser([uastring][,extensions])` * `new UAParser([uastring][,extensions])`
* returns new instance ```js
let parser = new UAParser("user-agent"); // you need to pass the user-agent for nodejs
console.log(parser); // {}
let parserResults = parser.getResult();
console.log(parserResults);
/** {
"ua": "",
"browser": {},
"engine": {},
"os": {},
"device": {},
"cpu": {}
} */
```
When you call UAParser without the `new` keyword, it will automatically call `getResult()` function and return the parsed results.
* `UAParser([uastring][,extensions])` * `UAParser([uastring][,extensions])`
* returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }` * returns result object `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
## Methods ## Methods
#### Methods table
The methods are self explanatory, here's a small overview on all the available methods:
* `getResult()` - returns all function object calls, user-agent string, browser info, cpu, device, engine, os:
`{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`.
* `getBrowser()` - returns the browser name and version.
* `getDevice()` - returns the device model, type, vendor.
* `getEngine()` - returns the current browser engine name and version.
* `getOS()` - returns the running operating system name and version.
* `getCPU()` - returns CPU architectural design name.
* `getUA()` - returns the user-agent string.
* `setUA(user-agent)` - set a custom user-agent to be parsed.
---
* `getResult()`
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
* `getBrowser()` * `getBrowser()`
* returns `{ name: '', version: '' }` * returns `{ name: '', version: '' }`
@ -38,17 +81,18 @@ JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model fro
2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG, 2345Explorer, 360 Browser, Amaya, Android Browser, Arora, Avant, Avast, AVG,
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera, BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo, Chrome Headless, Chrome WebView, Chrome, Chromium, Comodo Dragon, Dillo,
Dolphin, Doris, Edge, Electron, Epiphany, Facebook, Falkon, Fennec, Firebird, Dolphin, Doris, DuckDuckGo, Edge, Electron, Epiphany, Facebook, Falkon, Fennec,
Firefox [Reality], Flock, Flow, GSA, GoBrowser, ICE Browser, IE, IEMobile, IceApe, Firebird, Firefox [Focus/Reality], Flock, Flow, GSA, GoBrowser, Huawei Browser,
IceCat, IceDragon, Iceweasel, Instagram, Iridium, Iron, Jasmine, K-Meleon, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceweasel, Instagram,
Kindle, Klar, Konqueror, LBBROWSER, Line, Links, Lunascape, Lynx, MIUI Browser, Iridium, Iron, Jasmine, K-Meleon, Kindle, Klar, Konqueror, LBBROWSER, Line,
Maemo Browser, Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, LinkedIn, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser, Maemo, Maxthon,
Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Obigo, Oculus Browser, MetaSr Midori, Minimo, Mobile Safari, Mosaic, Mozilla, NetFront, NetSurf, Netfront,
OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, Netscape, NokiaBrowser, Obigo, Oculus Browser, OmniWeb, Opera Coast,
Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, Polaris, Puffin, QQ,
Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari, Sailfish Browser,
SlimBrowser, Swiftfox, Tesla, Tizen Browser, UCBrowser, UP.Browser, Vivaldi, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim, SlimBrowser, Swiftfox,
Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser... Tesla, Tizen Browser, UCBrowser, UP.Browser, Vivaldi, Waterfox, WeChat, Weibo,
Yandex, baidu, iCab, w3m, Whale Browser...
# 'browser.version' determined dynamically # 'browser.version' determined dynamically
``` ```
@ -60,6 +104,13 @@ Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser...
# Possible 'device.type': # Possible 'device.type':
console, mobile, tablet, smarttv, wearable, embedded console, mobile, tablet, smarttv, wearable, embedded
##########
# NOTE: 'desktop' is not a possible device type.
# UAParser only reports info directly available from the UA string, which is not the case for 'desktop' device type.
# If you wish to detect desktop devices, you must handle the needed logic yourself.
# You can read more about it in this issue: https://github.com/faisalman/ua-parser-js/issues/182
##########
# Possible 'device.vendor': # Possible 'device.vendor':
Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell, Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG, Essential, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Jolla, Lenovo, LG,
@ -88,11 +139,12 @@ NetSurf, Presto, Tasman, Trident, w3m, WebKit
# Possible 'os.name' # Possible 'os.name'
AIX, Amiga OS, Android[-x86], Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS, AIX, Amiga OS, Android[-x86], Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
Contiki, Fedora, Firefox OS, FreeBSD, Debian, Deepin, DragonFly, elementary OS, Contiki, Fedora, Firefox OS, FreeBSD, Debian, Deepin, DragonFly, elementary OS,
Fuchsia, Gentoo, GhostBSD, GNU, Haiku, HP-UX, Hurd, iOS, Joli, KaiOS, Linpus, Linspire, Fuchsia, Gentoo, GhostBSD, GNU, Haiku, HarmonyOS, HP-UX, Hurd, iOS, Joli, KaiOS,
Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix, Mint, Morph OS, NetBSD, Linpus, Linspire,Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix,
Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX, Mint, Morph OS, NetBSD, Nintendo, OpenBSD, OpenVMS, OS/2, Palm, PC-BSD, PCLinuxOS,
Raspbian, RedHat, RIM Tablet OS, RISC OS, Sabayon, Sailfish, Series40, Slackware, Solaris, Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS, RISC OS, Sabayon,
SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ... Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen, Ubuntu, Unix,
VectorLinux, WebOS, Windows [Phone/Mobile], Zenwalk, ...
# 'os.version' determined dynamically # 'os.version' determined dynamically
``` ```
@ -105,9 +157,6 @@ SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile],
68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64] 68k, amd64, arm[64/hf], avr, ia[32/64], irix[64], mips[64], pa-risc, ppc, sparc[64]
``` ```
* `getResult()`
* returns `{ ua: '', browser: {}, cpu: {}, device: {}, engine: {}, os: {} }`
* `getUA()` * `getUA()`
* returns UA string of current instance * returns UA string of current instance
@ -191,6 +240,8 @@ SUSE, Symbian, Tizen, Ubuntu, Unix, VectorLinux, WebOS, Windows [Phone/Mobile],
## Using node.js ## Using node.js
Note: Device information is not available in the NodeJS environment.
```sh ```sh
$ npm install ua-parser-js $ npm install ua-parser-js
``` ```

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v0.7.31 /* UAParser.js v0.7.33
Copyright © 2012-2021 Faisal Salman <f@faisalman.com> Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
MIT License */ /* MIT License */ /*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
@ -15,7 +15,7 @@
// Constants // Constants
///////////// /////////////
var LIBVERSION = "0.7.31", var LIBVERSION = "0.7.33",
EMPTY = "", EMPTY = "",
UNKNOWN = "?", UNKNOWN = "?",
FUNC_TYPE = "function", FUNC_TYPE = "function",
@ -35,7 +35,7 @@
SMARTTV = "smarttv", SMARTTV = "smarttv",
WEARABLE = "wearable", WEARABLE = "wearable",
EMBEDDED = "embedded", EMBEDDED = "embedded",
UA_MAX_LENGTH = 275; UA_MAX_LENGTH = 350;
var AMAZON = "Amazon", var AMAZON = "Amazon",
APPLE = "Apple", APPLE = "Apple",
@ -52,6 +52,7 @@
MOTOROLA = "Motorola", MOTOROLA = "Motorola",
OPERA = "Opera", OPERA = "Opera",
SAMSUNG = "Samsung", SAMSUNG = "Samsung",
SHARP = "Sharp",
SONY = "Sony", SONY = "Sony",
XIAOMI = "Xiaomi", XIAOMI = "Xiaomi",
ZEBRA = "Zebra", ZEBRA = "Zebra",
@ -90,7 +91,7 @@
}, },
trim = function (str, len) { trim = function (str, len) {
if (typeof str === STR_TYPE) { if (typeof str === STR_TYPE) {
str = str.replace(/^\s\s*/, EMPTY).replace(/\s\s*$/, EMPTY); str = str.replace(/^\s\s*/, EMPTY);
return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH); return typeof len === UNDEF_TYPE ? str : str.substring(0, UA_MAX_LENGTH);
} }
}; };
@ -237,7 +238,7 @@
/(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer /(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
// Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon // Webkit/KHTML based // Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron/Iridium/PhantomJS/Bowser/QupZilla/Falkon
/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i, /(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ // Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
/(weibo)__([\d\.]+)/i // Weibo /(weibo)__([\d\.]+)/i // Weibo
], ],
@ -247,7 +248,8 @@
], ],
[VERSION, [NAME, "UC" + BROWSER]], [VERSION, [NAME, "UC" + BROWSER]],
[ [
/\bqbcore\/([\w\.]+)/i // WeChat Desktop for Windows Built-in Browser /microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
/\bqbcore\/([\w\.]+).+microm/i
], ],
[VERSION, [NAME, "WeChat(Win) Desktop"]], [VERSION, [NAME, "WeChat(Win) Desktop"]],
[ [
@ -302,10 +304,10 @@
/\bqihu|(qi?ho?o?|360)browser/i // 360 /\bqihu|(qi?ho?o?|360)browser/i // 360
], ],
[[NAME, "360 " + BROWSER]], [[NAME, "360 " + BROWSER]],
[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i], [/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],
[[NAME, /(.+)/, "$1 " + BROWSER], VERSION], [[NAME, /(.+)/, "$1 " + BROWSER], VERSION],
[ [
// Oculus/Samsung/Sailfish Browser // Oculus/Samsung/Sailfish/Huawei Browser
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], ],
[[NAME, /_/g, " "], VERSION], [[NAME, /_/g, " "], VERSION],
@ -317,7 +319,8 @@
[NAME, VERSION], [NAME, VERSION],
[ [
/(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser /(metasr)[\/ ]?([\w\.]+)/i, // SouGouBrowser
/(lbbrowser)/i // LieBao Browser /(lbbrowser)/i, // LieBao Browser
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android
], ],
[NAME], [NAME],
[ [
@ -352,11 +355,11 @@
], ],
[NAME, VERSION], [NAME, VERSION],
[ [
/version\/([\w\.]+) .*mobile\/\w+ (safari)/i // Mobile Safari /version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i // Mobile Safari
], ],
[VERSION, [NAME, "Mobile Safari"]], [VERSION, [NAME, "Mobile Safari"]],
[ [
/version\/([\w\.]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile /version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i // Safari & Safari Mobile
], ],
[VERSION, NAME], [VERSION, NAME],
[ [
@ -389,7 +392,11 @@
// Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf/Sleipnir/Obigo/Mosaic/Go/ICE/UP.Browser
/(links) \(([\w\.]+)/i // Links /(links) \(([\w\.]+)/i // Links
], ],
[NAME, VERSION] [NAME, VERSION],
[
/(cobalt)\/([\w\.]+)/i // Cobalt
],
[NAME, [VERSION, /master.|lts./, ""]]
], ],
cpu: [ cpu: [
@ -441,7 +448,7 @@
///////////////////////// /////////////////////////
// Samsung // Samsung
/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i /\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i
], ],
[MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]], [MODEL, [VENDOR, SAMSUNG], [TYPE, TABLET]],
[ [
@ -452,14 +459,6 @@
[MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]],
[ [
// Apple // Apple
/((ipod|iphone)\d+,\d+)/i // iPod/iPhone model
],
[MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],
[
/(ipad\d+,\d+)/i // iPad model
],
[MODEL, [VENDOR, APPLE], [TYPE, TABLET]],
[
/\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone /\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone
], ],
[MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]],
@ -469,6 +468,8 @@
/\b(ipad)\d\d?,\d\d?[;\]].+ios/i /\b(ipad)\d\d?,\d\d?[;\]].+ios/i
], ],
[MODEL, [VENDOR, APPLE], [TYPE, TABLET]], [MODEL, [VENDOR, APPLE], [TYPE, TABLET]],
[/(macintosh);/i],
[MODEL, [VENDOR, APPLE]],
[ [
// Huawei // Huawei
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i /\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
@ -639,7 +640,7 @@
// Sharp // Sharp
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i /\b(sh-?[altvz]?\d\d[a-ekm]?)/i
], ],
[MODEL, [VENDOR, "Sharp"], [TYPE, MOBILE]], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]],
[ [
// MIXED // MIXED
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,
@ -836,13 +837,18 @@
], ],
[MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]], [MODEL, [VENDOR, AMAZON], [TYPE, SMARTTV]],
[ [
/\(dtv[\);].+(aquos)/i // Sharp /\(dtv[\);].+(aquos)/i,
/(aquos-tv[\w ]+)\)/i // Sharp
], ],
[MODEL, [VENDOR, "Sharp"], [TYPE, SMARTTV]], [MODEL, [VENDOR, SHARP], [TYPE, SMARTTV]],
[ [
/(bravia[\w- ]+) bui/i // Sony /(bravia[\w ]+)( bui|\))/i // Sony
], ],
[MODEL, [VENDOR, SONY], [TYPE, SMARTTV]], [MODEL, [VENDOR, SONY], [TYPE, SMARTTV]],
[
/(mitv-\w{5}) bui/i // Xiaomi
],
[MODEL, [VENDOR, XIAOMI], [TYPE, SMARTTV]],
[ [
/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku /\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i, // Roku
/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i // HbbTV devices /hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i // HbbTV devices
@ -899,7 +905,7 @@
], ],
[[TYPE, TABLET]], [[TYPE, TABLET]],
[ [
/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile /(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i // Unidentifiable Mobile
], ],
[[TYPE, MOBILE]], [[TYPE, MOBILE]],
[ [
@ -967,7 +973,7 @@
], ],
[ [
// Mobile OSes // Mobile OSes
/droid ([\w\.]+)\b.+(android[- ]x86)/i // Android-x86 /droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS
], ],
[VERSION, NAME], [VERSION, NAME],
[ [

View File

@ -299,6 +299,16 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "DuckDuckGo",
"ua" : "Mozilla/5.0 (Linux; Android 8.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile DuckDuckGo/5 Safari/537.36",
"expect" :
{
"name" : "DuckDuckGo",
"version" : "5",
"major" : "5"
}
},
{ {
"desc" : "Epiphany", "desc" : "Epiphany",
"ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6", "ua" : "Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7) Gecko/20040628 Epiphany/1.2.6",
@ -498,6 +508,46 @@
"major" : "1" "major" : "1"
} }
}, },
{
"desc" : "HuaweiBrowser",
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; LYA-AL00HMSCore/4.0.0 GMS/10.4 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.102 Mobile Safari/537.36",
"expect" :
{
"name" : "Huawei Browser",
"version" : "10.0.3.102",
"major" : "10"
}
},
{
"desc" : "HuaweiBrowser",
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; LYA-AL00HMSCore/4.0.0 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.102 Mobile Safari/537.36",
"expect" :
{
"name" : "Huawei Browser",
"version" : "10.0.3.102",
"major" : "10"
}
},
{
"desc" : "HuaweiBrowser",
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; LYA-AL00GMS/10.4 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.102 Mobile Safari/537.36",
"expect" :
{
"name" : "Huawei Browser",
"version" : "10.0.3.102",
"major" : "10"
}
},
{
"desc" : "HuaweiBrowser",
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; LYA-AL00 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.64 HuaweiBrowser/10.0.3.102 Mobile Safari/537.36",
"expect" :
{
"name" : "Huawei Browser",
"version" : "10.0.3.102",
"major" : "10"
}
},
{ {
"desc" : "IceApe", "desc" : "IceApe",
"ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.19) Gecko/20110817 Iceape/2.0.14", "ua" : "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.19) Gecko/20110817 Iceape/2.0.14",
@ -1209,7 +1259,7 @@
} }
}, },
{ {
"desc": "WeChat on Android", "desc": "WeiBo on Android",
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A366 Weibo (iPhone8,2__weibo__8.9.3__iphone__os12.0)", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/16A366 Weibo (iPhone8,2__weibo__8.9.3__iphone__os12.0)",
"expect": "expect":
{ {
@ -1408,6 +1458,16 @@
"major" : "4" "major" : "4"
} }
}, },
{
"desc" : "Supposed not to be detected as WeChat",
"ua" : "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.124 Safari/537.36 qblink wegame.exe WeGame/5.1.1.11100 QBCore/3.70.107.400 QQBrowser/9.0.2524.400",
"expect" :
{
"name" : "QQBrowser",
"version" : "9.0.2524.400",
"major" : "9"
}
},
{ {
"desc" : "GSA on iOS", "desc" : "GSA on iOS",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) GSA/30.1.161623614 Mobile/14F89 Safari/602.1", "ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_2 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) GSA/30.1.161623614 Mobile/14F89 Safari/602.1",
@ -1503,5 +1563,69 @@
"version" : "11.0", "version" : "11.0",
"major" : "11" "major" : "11"
} }
},
{
"desc" : "LinkedIn",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [LinkedInApp]",
"expect" :
{
"name" : "LinkedIn"
}
},
{
"desc" : "Safari including comma in minor version number",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6,2 Safari/605.1.15",
"expect" :
{
"name" : "Safari",
"version" : "15.6,2",
"major" : "15"
}
},
{
"desc" : "Mobile Safari including comma in minor version number",
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 15_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6,2 Mobile/15E148 Safari/604.1",
"expect" :
{
"name" : "Mobile Safari",
"version" : "15.6,2",
"major" : "15"
}
},
{
"desc" : "Cobalt 23 Master",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.master.0.0-devel (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15",
"expect" : {
"name" : "Cobalt",
"version": "23.0.0",
"major" : "23"
}
},
{
"desc" : "Cobalt 23 LTS",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/23.lts.1.0-qa (unlike Gecko) v8/8.8.278.8-jit gles Starboard/15",
"expect" : {
"name" : "Cobalt",
"version": "23.1.0",
"major" : "23"
}
},
{
"desc" : "Cobalt 11",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/11.0-qa (unlike Gecko) Starboard/6",
"expect" : {
"name" : "Cobalt",
"version": "11.0",
"major" : "11"
}
},
{
"desc" : "Cobalt 9",
"ua" : "Mozilla/5.0 (X11; Linux x86_64) Cobalt/9.0-qa (unlike Gecko) Starboard/4",
"expect" : {
"name" : "Cobalt",
"version": "9.0",
"major" : "9"
}
} }
] ]

View File

@ -196,6 +196,15 @@
"type": "undefined" "type": "undefined"
} }
}, },
{
"desc": "Mobile (DuckDuckGo mobile browser)",
"ua": "Mozilla/5.0 (Linux; Android 8.1.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile DuckDuckGo/5 Safari/537.36",
"expect": {
"vendor": "undefined",
"model": "undefined",
"type": "mobile"
}
},
{ {
"desc": "Essential PH-1", "desc": "Essential PH-1",
"ua": "Mozilla/5.0 (Linux; Android 9; PH-1 Build/PPR1.180905.036) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36", "ua": "Mozilla/5.0 (Linux; Android 9; PH-1 Build/PPR1.180905.036) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.86 Mobile Safari/537.36",
@ -745,12 +754,21 @@
"type": "mobile" "type": "mobile"
} }
}, },
{
"desc": "Apple Desktop",
"ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15",
"expect": {
"vendor": "Apple",
"model": "Macintosh",
"type": "undefined"
}
},
{ {
"desc": "iPad using UCBrowser", "desc": "iPad using UCBrowser",
"ua": "Mozilla/5.0 (iPad; U; CPU OS 11_2 like Mac OS X; zh-CN; iPad5,3) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/3.0.1.776 U3/ Mobile/10A403 Safari/7543.48.3", "ua": "Mozilla/5.0 (iPad; U; CPU OS 11_2 like Mac OS X; zh-CN; iPad5,3) AppleWebKit/534.46 (KHTML, like Gecko) UCBrowser/3.0.1.776 U3/ Mobile/10A403 Safari/7543.48.3",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPad5,3", "model": "iPad",
"type": "tablet" "type": "tablet"
} }
}, },
@ -759,7 +777,7 @@
"ua": "Mozilla/5.0 (iPad; CPU OS 12_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPad4,1;FBMD/iPad;FBSN/iOS;FBSV/12.4.5;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5;FBCR/]", "ua": "Mozilla/5.0 (iPad; CPU OS 12_4_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPad4,1;FBMD/iPad;FBSN/iOS;FBSV/12.4.5;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5;FBCR/]",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPad4,1", "model": "iPad",
"type": "tablet" "type": "tablet"
} }
}, },
@ -768,7 +786,7 @@
"ua": "Mozilla/5.0 (iPad; CPU OS 14_4_2 like Mac OS X) WebKit/8610 (KHTML, like Gecko) Mobile/18D70 [FBAN/FBIOS;FBDV/iPad7,11;FBMD/iPad;FBSN/iOS;FBSV/14.4.2;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5]", "ua": "Mozilla/5.0 (iPad; CPU OS 14_4_2 like Mac OS X) WebKit/8610 (KHTML, like Gecko) Mobile/18D70 [FBAN/FBIOS;FBDV/iPad7,11;FBMD/iPad;FBSN/iOS;FBSV/14.4.2;FBSS/2;FBID/tablet;FBLC/en_US;FBOP/5]",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPad7,11", "model": "iPad",
"type": "tablet" "type": "tablet"
} }
}, },
@ -1058,7 +1076,7 @@
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPhone8,4", "model": "iPhone",
"type": "mobile" "type": "mobile"
} }
}, },
@ -1067,7 +1085,7 @@
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone8,4;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPhone8,4", "model": "iPhone",
"type": "mobile" "type": "mobile"
} }
}, },
@ -1076,7 +1094,7 @@
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone12,5;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone12,5;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPhone12,5", "model": "iPhone",
"type": "mobile" "type": "mobile"
} }
}, },
@ -1085,7 +1103,7 @@
"ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone11,2;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]", "ua": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 [FBAN/FBIOS;FBDV/iPhone11,2;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBID/phone;FBLC/en_US;FBOP/5;FBCR/]",
"expect": { "expect": {
"vendor": "Apple", "vendor": "Apple",
"model": "iPhone11,2", "model": "iPhone",
"type": "mobile" "type": "mobile"
} }
}, },
@ -1458,6 +1476,15 @@
"type": "smarttv" "type": "smarttv"
} }
}, },
{
"desc": "Xiaomi TV",
"ua": "Mozilla/5.0 (Linux; Android 10; MiTV-MOOQ0 Build/QTG3.200305.006; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/94.0.4606.61 Mobile Safari/537.36",
"expect": {
"vendor": "Xiaomi",
"model": "MiTV-MOOQ0",
"type": "smarttv"
}
},
{ {
"desc": "Kindle Fire HD", "desc": "Kindle Fire HD",
"ua": "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true", "ua": "Mozilla/5.0 (Linux; U; Android 4.0.3; en-us; KFTT Build/IML74K) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.4 Mobile Safari/535.19 Silk-Accelerated=true",
@ -1620,6 +1647,15 @@
"type": "tablet" "type": "tablet"
} }
}, },
{
"desc": "Samsung Galaxy Tab S8",
"ua": "Mozilla/5.0 (Linux; Android 12; SM-X706B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.53 Safari/537.36",
"expect": {
"vendor": "Samsung",
"model": "SM-X706B",
"type": "tablet"
}
},
{ {
"desc": "Samsung Galaxy Tab S", "desc": "Samsung Galaxy Tab S",
"ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T700 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36", "ua": "Mozilla/5.0 (Linux; Android 4.4.2; SM-T700 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.135 Safari/537.36",
@ -1692,6 +1728,15 @@
"type": "smarttv" "type": "smarttv"
} }
}, },
{
"desc": "Sharp AQUOS-TVX19B",
"ua": "Mozilla/5.0 (Linux; Android 9; AQUOS-TVX19B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36",
"expect": {
"vendor": "Sharp",
"model": "AQUOS-TVX19B",
"type": "smarttv"
}
},
{ {
"desc": "Sharp Aquos B10", "desc": "Sharp Aquos B10",
"ua": "Mozilla/5.0 (Linux; Android 7.0; SH-A01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36", "ua": "Mozilla/5.0 (Linux; Android 7.0; SH-A01) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Mobile Safari/537.36",
@ -1872,6 +1917,24 @@
"type": "smarttv" "type": "smarttv"
} }
}, },
{
"desc": "Sony BRAVIA 4K GB ATV3",
"ua": "Mozilla/5.0 (Linux; Android 9; BRAVIA 4K GB ATV3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Mobile Safari/537.36",
"expect": {
"vendor": "Sony",
"model": "BRAVIA 4K GB ATV3",
"type": "smarttv"
}
},
{
"desc": "Sony Bravia 4k UR2",
"ua": "Mozilla/5.0 (Linux: Andr0id 9: BRAVIA 4K UR2 Build/PTT1.190515.001.S104) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36 OPR/46.0.2207.0 OMI/4.13.5.431.DIA5HBBTV.250 Model/Sony-BRAVIA-4K-UR2",
"expect": {
"vendor": "Sony",
"model": "BRAVIA 4K UR2",
"type": "smarttv"
}
},
{ {
"desc" : "Tesla", "desc" : "Tesla",
"ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Tesla QtCarBrowser Safari/601.1", "ua" : "Mozilla/5.0 (X11; GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Tesla QtCarBrowser Safari/601.1",
@ -2864,9 +2927,7 @@
"desc": "FaceBook Mobile App", "desc": "FaceBook Mobile App",
"ua": "[FBAN/FBIOS;FBAV/283.0.0.44.117;FBBV/238386386;FBDV/iPhone12,1;FBMD/iPhone;FBSN/iOS;FBSV/13.6.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBRV/240127608]", "ua": "[FBAN/FBIOS;FBAV/283.0.0.44.117;FBBV/238386386;FBDV/iPhone12,1;FBMD/iPhone;FBSN/iOS;FBSV/13.6.1;FBSS/2;FBID/phone;FBLC/en_US;FBOP/5;FBRV/240127608]",
"expect": { "expect": {
"type": "mobile", "type": "mobile"
"model": "iPhone12,1",
"vendor": "Apple"
} }
}, },
{ {

View File

@ -206,6 +206,15 @@
"version" : "2.2.2" "version" : "2.2.2"
} }
}, },
{
"desc" : "HarmonyOS",
"ua" : "Mozilla/5.0 (Linux; Android 10; HarmonyOS; YAL-AL10; HMSCore 6.3.0.327; GMSCore 21.48.15) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.105 HuaweiBrowser/12.0.3.310 Mobile Safari/537.36",
"expect" :
{
"name" : "HarmonyOS",
"version" : "10"
}
},
{ {
"desc" : "Sailfish", "desc" : "Sailfish",
"ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0", "ua" : "Mozilla/5.0 (Linux; U; Sailfish 3.0; Mobile; rv:45.0) Gecko/45.0 Firefox/45.0 SailfishBrowser/1.0",

File diff suppressed because one or more lines are too long