mirror of
https://github.com/faisalman/ua-parser-js.git
synced 2025-11-15 14:42:16 +03:00
Compare commits
15 Commits
2.0.0-rc.1
...
1.0.35
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d810feb844 | ||
|
|
32d326b35b | ||
|
|
786d502b01 | ||
|
|
5b8adfef7b | ||
|
|
2e06a34062 | ||
|
|
bf9ac43328 | ||
|
|
3f8b5ba9cf | ||
|
|
1747707be6 | ||
|
|
d41404551f | ||
|
|
ba067bd351 | ||
|
|
a486f28732 | ||
|
|
3218051f07 | ||
|
|
551ad88474 | ||
|
|
097f736c4d | ||
|
|
73c25771dc |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.7.33",
|
||||
"version": "1.0.35",
|
||||
"authors": [
|
||||
"Faisal Salman <f@faisalman.com>"
|
||||
],
|
||||
|
||||
57
changelog.md
57
changelog.md
@@ -4,24 +4,30 @@
|
||||
|
||||
Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://github.com/faisalman/ua-parser-js/issues/536) for the reason behind this confusion.
|
||||
|
||||
## Version 0.7.30 / 1.0.1
|
||||
## Version 0.7.35 / 1.0.35
|
||||
- Fix result from user-supplied user-agent being altered
|
||||
- Add new browser: Heytap, TikTok
|
||||
- Add new engine: LibWeb
|
||||
- Add new OS: SerenityOS
|
||||
- Improve browser detection: Yandex
|
||||
- Improve device detection: iPhone, Amazon Echo
|
||||
- Improve OS detection: iOS
|
||||
|
||||
- Add new browser : Obigo, UP.Browser, Klar
|
||||
- Add new device : Oculus, Roku
|
||||
- Add new OS: Maemo, HP-UX, Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon
|
||||
- Improve detection for Sony Xperia 1ii, LG Android TV, and some more devices
|
||||
- Improve detection for ARM64 CPU
|
||||
- Improve detection for Windows Mobile, Netscape, Mac on PowerPC
|
||||
- Categorize PDA as mobile
|
||||
- Fix Sharp devices misjudged as Huawei
|
||||
- Fix trailing comma for ES3 compatibility
|
||||
- Some code refactor
|
||||
## Version 0.7.34 / 1.0.34
|
||||
- Fix Sharp Mobile detected as Huawei Tablet
|
||||
- Fix IE8 bug
|
||||
- Add new devices : Kobo e-Reader, Apple Watch, and some new SmartTV devices
|
||||
- Add new OS : watchOS
|
||||
- Improve browser detection : Kakao, Naver, Brave
|
||||
- Improve device detection : Oculus, iPad
|
||||
- Improve OS detection : Chrome OS
|
||||
- Using navigator.userAgentData as fallback for device.type & os.name
|
||||
|
||||
## Version 0.7.31 / 1.0.2
|
||||
## Version 0.7.33 / 1.0.33
|
||||
|
||||
- Fix OPPO Reno A5 incorrect detection
|
||||
- Fix TypeError Bug
|
||||
- Use AST to extract regexes and verify them with safe-regex
|
||||
- Add new browser : Cobalt
|
||||
- Identify Macintosh as an Apple device
|
||||
- Fix ReDoS vulnerability
|
||||
|
||||
## Version 0.7.32 / 1.0.32
|
||||
|
||||
@@ -38,11 +44,24 @@ Version 1.0.x is basically the equivalent of version 0.7.x. See [#536](https://g
|
||||
- Fix included commas in Safari / Mobile Safari version
|
||||
- Increase UA_MAX_LENGTH to 350
|
||||
|
||||
## Version 0.7.33 / 1.0.33
|
||||
## Version 0.7.31 / 1.0.2
|
||||
|
||||
- Add new browser : Cobalt
|
||||
- Identify Macintosh as an Apple device
|
||||
- Fix ReDoS vulnerability
|
||||
- Fix OPPO Reno A5 incorrect detection
|
||||
- Fix TypeError Bug
|
||||
- Use AST to extract regexes and verify them with safe-regex
|
||||
|
||||
## Version 0.7.30 / 1.0.1
|
||||
|
||||
- Add new browser : Obigo, UP.Browser, Klar
|
||||
- Add new device : Oculus, Roku
|
||||
- Add new OS: Maemo, HP-UX, Android-x86, Deepin, elementary OS, GhostBSD, Linspire, Manjaro, Sabayon
|
||||
- Improve detection for Sony Xperia 1ii, LG Android TV, and some more devices
|
||||
- Improve detection for ARM64 CPU
|
||||
- Improve detection for Windows Mobile, Netscape, Mac on PowerPC
|
||||
- Categorize PDA as mobile
|
||||
- Fix Sharp devices misjudged as Huawei
|
||||
- Fix trailing comma for ES3 compatibility
|
||||
- Some code refactor
|
||||
|
||||
# Version 0.8
|
||||
|
||||
|
||||
4
dist/ua-parser.min.js
vendored
4
dist/ua-parser.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/ua-parser.pack.js
vendored
4
dist/ua-parser.pack.js
vendored
File diff suppressed because one or more lines are too long
19
images/51degrees.svg
Normal file
19
images/51degrees.svg
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 23.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 161.93 86.82" style="enable-background:new 0 0 161.93 86.82;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#232628;}
|
||||
.st1{fill:#E62E3A;}
|
||||
.st2{fill:none;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M116.93,0.68H103.5V17.5h13.43c15.24,0,25.53,10.53,25.53,25.53v0.24c0,15-10.28,25.29-25.53,25.29H103.5
|
||||
v16.82h13.43c26.62,0,45-18.51,45-42.34v-0.24C161.93,18.95,143.54,0.68,116.93,0.68"/>
|
||||
<path class="st1" d="M8.11,0.68h52.02v16.33H24.07l-0.97,14.64c3.39-0.85,6.41-1.45,11.13-1.45c16.7,0,29.64,7.99,29.64,27.22
|
||||
c0,18.03-12.7,29.4-32.18,29.4c-13.55,0-23.47-4.84-31.7-12.7l11.25-13.43c6.41,5.81,12.7,9.19,20.2,9.19
|
||||
c8.71,0,14.15-4.23,14.15-11.86c0-7.38-5.93-11.61-15-11.61c-5.32,0-10.16,1.45-14.16,3.15L5.69,42.42L8.11,0.68z"/>
|
||||
<polygon class="st1" points="86.14,0 98.84,0 98.84,85.29 80.45,85.29 80.45,18.87 65.69,22.5 61.82,7.26 "/>
|
||||
</g>
|
||||
<rect x="144.06" y="110.12" class="st2" width="566.93" height="113.39"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -1,6 +1,6 @@
|
||||
Package.describe({
|
||||
name: 'faisalman:ua-parser-js',
|
||||
version: '0.7.33',
|
||||
version: '1.0.35',
|
||||
summary: 'Lightweight JavaScript-based user-agent string parser',
|
||||
git: 'https://github.com/faisalman/ua-parser-js.git',
|
||||
documentation: 'readme.md'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"title": "UAParser.js",
|
||||
"name": "ua-parser-js",
|
||||
"version": "0.7.33",
|
||||
"version": "1.0.35",
|
||||
"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",
|
||||
"keywords": [
|
||||
|
||||
44
readme.md
44
readme.md
@@ -18,6 +18,26 @@ JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model fro
|
||||
* Demo : https://faisalman.github.io/ua-parser-js
|
||||
* Source : https://github.com/faisalman/ua-parser-js
|
||||
|
||||
***
|
||||
|
||||
### From Our Sponsors:
|
||||
<table>
|
||||
<thead>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center" width="200px" rowspan="3"><a href="https://www.npmjs.com/package/@51degrees/ua-parser-js"><img src="images/51degrees.svg" alt="51degrees" width="75%" height="75%" ></a></td>
|
||||
<td align="left" width="400px"><a href="https://www.npmjs.com/package/@51degrees/ua-parser-js">↗ @51degrees/ua-parser-js</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><br/><p>UAParser.js has been upgraded to detect comprehensive device data based on the User-Agent and User-Agent Client Hints.</p><p>This package supports all device types including Apple and Android devices and can be used either in a browser (client-side) or Node.js environment (server-side).</p><p>Visit <a href="https://www.npmjs.com/package/@51degrees/ua-parser-js">↗ 51Degrees <u>UAParser</u></a> to get started.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
# Documentation
|
||||
### UAParser([user-agent][,extensions])
|
||||
typeof `user-agent` "string".
|
||||
@@ -82,16 +102,16 @@ The methods are self explanatory, here's a small overview on all the available m
|
||||
BIDUBrowser, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
|
||||
Chrome Headless, Chrome WebView, Chrome, Chromium, Cobalt, Comodo Dragon, Dillo,
|
||||
Dolphin, Doris, DuckDuckGo, Edge, Electron, Epiphany, Facebook, Falkon, Fennec,
|
||||
Firebird, Firefox [Focus/Reality], Flock, Flow, GSA, GoBrowser, Huawei Browser,
|
||||
ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceweasel, Instagram,
|
||||
Iridium, Iron, Jasmine, Kakao[Story/Talk], K-Meleon, Kindle, Klar, Konqueror,
|
||||
LBBROWSER, Line, LinkedIn, Links, Lunascape, Lynx, MIUI Browser, Maemo Browser,
|
||||
Firebird, Firefox [Focus/Reality], Flock, Flow, GSA, GoBrowser, Heytap,
|
||||
Huawei Browser, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon, Iceweasel,
|
||||
Instagram, Iridium, Iron, Jasmine, Kakao[Story/Talk], K-Meleon, Kindle, Klar,
|
||||
Konqueror, LBBROWSER, Line, LinkedIn, Links, Lunascape, Lynx, MIUI Browser,
|
||||
Maemo, Maxthon, MetaSr Midori, Minimo, Mobile Safari, Mosaic, Mozilla, NetFront,
|
||||
NetSurf, Netfront, Netscape, NokiaBrowser, Obigo, Oculus Browser, OmniWeb,
|
||||
Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon, PhantomJS, Phoenix, Polaris,
|
||||
Puffin, QQ, QQBrowser, QQBrowserLite, Quark, QupZilla, RockMelt, Safari,
|
||||
Sailfish Browser, Samsung Browser, SeaMonkey, Silk, Skyfire, Sleipnir, Slim,
|
||||
SlimBrowser, Swiftfox, Tesla, Tizen Browser, UCBrowser, UP.Browser, Viera,
|
||||
SlimBrowser, Swiftfox, Tesla, TikTok, Tizen Browser, UCBrowser, UP.Browser, Viera,
|
||||
Vivaldi, Waterfox, WeChat, Weibo, Yandex, baidu, iCab, w3m, Whale Browser...
|
||||
|
||||
# 'browser.version' determined dynamically
|
||||
@@ -126,8 +146,8 @@ Siemens, Sony[Ericsson], Sprint, Tesla, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE
|
||||
|
||||
```sh
|
||||
# Possible 'engine.name'
|
||||
Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, Links, Lynx, NetFront,
|
||||
NetSurf, Presto, Tasman, Trident, w3m, WebKit
|
||||
Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, LibWeb, Links, Lynx,
|
||||
NetFront, NetSurf, Presto, Tasman, Trident, w3m, WebKit
|
||||
|
||||
# 'engine.version' determined dynamically
|
||||
```
|
||||
@@ -143,8 +163,9 @@ Fuchsia, Gentoo, GhostBSD, GNU, Haiku, HarmonyOS, HP-UX, Hurd, iOS, Joli, KaiOS,
|
||||
Linpus, Linspire,Linux, Mac OS, Maemo, Mageia, Mandriva, Manjaro, MeeGo, Minix,
|
||||
Mint, Morph OS, NetBSD, NetRange, NetTV, Nintendo, OpenBSD, OpenVMS, OS/2, Palm,
|
||||
PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX, Raspbian, RedHat, RIM Tablet OS,
|
||||
RISC OS, Sabayon, Sailfish, Series40, Slackware, Solaris, SUSE, Symbian, Tizen,
|
||||
Ubuntu, Unix, VectorLinux, Viera, WebOS, Windows [Phone/Mobile], Zenwalk, ...
|
||||
RISC OS, Sabayon, Sailfish, SerenityOS, Series40, Slackware, Solaris, SUSE, Symbian,
|
||||
Tizen, Ubuntu, Unix, VectorLinux, Viera, watchOS, WebOS, Windows [Phone/Mobile],
|
||||
Zenwalk, ...
|
||||
|
||||
# 'os.version' determined dynamically
|
||||
```
|
||||
@@ -312,9 +333,10 @@ console.log(myParser.setUA(myUA).getBrowser()); // {name: "MyBrowser", version:
|
||||
|
||||
# Development
|
||||
|
||||
## Sponsors
|
||||
## Backers & Sponsors
|
||||
|
||||
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/tiers/backers.svg?avatarHeight=64" height="80"/></a> <a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/tiers/sponsors.svg?avatarHeight=64" height="80"/></a>
|
||||
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/organizations.svg?avatarHeight=64"></a>
|
||||
<a href="https://opencollective.com/ua-parser-js"><img src="https://opencollective.com/ua-parser-js/individuals.svg?avatarHeight=64"></a>
|
||||
|
||||
<a href="https://www.paypal.me/faisalman/"><img src="https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg" height="40"></a>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
/* UAParser.js v0.7.33
|
||||
/* UAParser.js v1.0.35
|
||||
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
|
||||
MIT License *//*
|
||||
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
|
||||
@@ -17,7 +17,7 @@
|
||||
/////////////
|
||||
|
||||
|
||||
var LIBVERSION = '0.7.33',
|
||||
var LIBVERSION = '1.0.35',
|
||||
EMPTY = '',
|
||||
UNKNOWN = '?',
|
||||
FUNC_TYPE = 'function',
|
||||
@@ -59,7 +59,9 @@
|
||||
VIERA = 'Viera',
|
||||
XIAOMI = 'Xiaomi',
|
||||
ZEBRA = 'Zebra',
|
||||
FACEBOOK = 'Facebook';
|
||||
FACEBOOK = 'Facebook',
|
||||
CHROMIUM_OS = 'Chromium OS',
|
||||
MAC_OS = 'Mac OS';
|
||||
|
||||
///////////
|
||||
// Helper
|
||||
@@ -234,8 +236,9 @@
|
||||
/(?:ms|\()(ie) ([\w\.]+)/i, // Internet Explorer
|
||||
|
||||
// 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(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
||||
/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,
|
||||
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ, aka ShouQ
|
||||
/(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
|
||||
/(weibo)__([\d\.]+)/i // Weibo
|
||||
], [NAME, VERSION], [
|
||||
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
|
||||
@@ -249,7 +252,7 @@
|
||||
], [VERSION, [NAME, 'Konqueror']], [
|
||||
/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i // IE11
|
||||
], [VERSION, [NAME, 'IE']], [
|
||||
/yabrowser\/([\w\.]+)/i // Yandex
|
||||
/ya(?:search)?browser\/([\w\.]+)/i // Yandex
|
||||
], [VERSION, [NAME, 'Yandex']], [
|
||||
/(avast|avg)\/([\w\.]+)/i // Avast/AVG Secure Browser
|
||||
], [[NAME, /(.+)/, '$1 Secure '+BROWSER], VERSION], [
|
||||
@@ -293,6 +296,8 @@
|
||||
], [NAME, VERSION], [
|
||||
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
|
||||
], [VERSION, [NAME, 'GSA']], [
|
||||
/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i // TikTok
|
||||
], [VERSION, [NAME, 'TikTok']], [
|
||||
|
||||
/headlesschrome(?:\/([\w\.]+)| )/i // Chrome Headless
|
||||
], [VERSION, [NAME, CHROME+' Headless']], [
|
||||
@@ -388,7 +393,7 @@
|
||||
], [MODEL, [VENDOR, SAMSUNG], [TYPE, MOBILE]], [
|
||||
|
||||
// Apple
|
||||
/\((ip(?:hone|od)[\w ]*);/i // iPod/iPhone
|
||||
/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i // iPod/iPhone
|
||||
], [MODEL, [VENDOR, APPLE], [TYPE, MOBILE]], [
|
||||
/\((ipad);[-\w\),; ]+apple/i, // iPad
|
||||
/applecoremedia\/[\w\.]+ \((ipad)/i,
|
||||
@@ -478,7 +483,7 @@
|
||||
|
||||
// Amazon
|
||||
/(alexa)webm/i,
|
||||
/(kf[a-z]{2}wi)( bui|\))/i, // Kindle Fire without Silk
|
||||
/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i, // Kindle Fire without Silk / Echo Show
|
||||
/(kf[a-z]+)( bui|\)).+silk\//i // Kindle Fire HD
|
||||
], [MODEL, [VENDOR, AMAZON], [TYPE, TABLET]], [
|
||||
/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i // Fire Phone
|
||||
@@ -648,6 +653,8 @@
|
||||
|
||||
/((pebble))app/i // Pebble
|
||||
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
|
||||
/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i // Apple Watch
|
||||
], [MODEL, [VENDOR, APPLE], [TYPE, WEARABLE]], [
|
||||
/droid.+; (glass) \d/i // Google Glass
|
||||
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
|
||||
/droid.+; (wt63?0{2,3})\)/i
|
||||
@@ -661,6 +668,8 @@
|
||||
|
||||
/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i // Tesla
|
||||
], [VENDOR, [TYPE, EMBEDDED]], [
|
||||
/(aeobc)\b/i // Echo Dot
|
||||
], [MODEL, [VENDOR, AMAZON], [TYPE, EMBEDDED]], [
|
||||
|
||||
////////////////////
|
||||
// MIXED (GENERIC)
|
||||
@@ -690,7 +699,8 @@
|
||||
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
|
||||
/ekioh(flow)\/([\w\.]+)/i, // Flow
|
||||
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
|
||||
/(icab)[\/ ]([23]\.[\d\.]+)/i // iCab
|
||||
/(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
|
||||
/\b(libweb)/i
|
||||
], [NAME, VERSION], [
|
||||
|
||||
/rv\:([\w\.]{1,9})\b.+(gecko)/i // Gecko
|
||||
@@ -711,11 +721,12 @@
|
||||
|
||||
// iOS/macOS
|
||||
/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i, // iOS
|
||||
/ios;fbsv\/([\d\.]+)/i,
|
||||
/cfnetwork\/.+darwin/i
|
||||
], [[VERSION, /_/g, '.'], [NAME, 'iOS']], [
|
||||
/(mac os x) ?([\w\. ]*)/i,
|
||||
/(macintosh|mac_powerpc\b)(?!.+haiku)/i // Mac OS
|
||||
], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [
|
||||
], [[NAME, MAC_OS], [VERSION, /_/g, '.']], [
|
||||
|
||||
// Mobile OSes
|
||||
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS
|
||||
@@ -734,12 +745,14 @@
|
||||
/web0s;.+rt(tv)/i,
|
||||
/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i // WebOS
|
||||
], [VERSION, [NAME, 'webOS']], [
|
||||
/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i // watchOS
|
||||
], [VERSION, [NAME, 'watchOS']], [
|
||||
|
||||
// Google Chromecast
|
||||
/crkey\/([\d\.]+)/i // Google Chromecast
|
||||
], [VERSION, [NAME, CHROME+'cast']], [
|
||||
/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i // Chromium OS
|
||||
], [[NAME, 'Chromium OS'], VERSION],[
|
||||
], [[NAME, CHROMIUM_OS], VERSION],[
|
||||
|
||||
// Smart TVs
|
||||
/panasonic;(viera)/i, // Panasonic Viera
|
||||
@@ -765,7 +778,7 @@
|
||||
], [[NAME, 'Solaris'], VERSION], [
|
||||
/((?:open)?solaris)[-\/ ]?([\w\.]*)/i, // Solaris
|
||||
/(aix) ((\d)(?=\.|\)| )[\w\.])*/i, // AIX
|
||||
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX
|
||||
/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i, // BeOS/OS2/AmigaOS/MorphOS/OpenVMS/Fuchsia/HP-UX/SerenityOS
|
||||
/(unix) ?([\w\.]*)/i // UNIX
|
||||
], [NAME, VERSION]
|
||||
]
|
||||
@@ -786,16 +799,22 @@
|
||||
return new UAParser(ua, extensions).getResult();
|
||||
}
|
||||
|
||||
var _ua = ua || ((typeof window !== UNDEF_TYPE && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY);
|
||||
var _uach = (typeof window !== UNDEF_TYPE && window.navigator && window.navigator.userAgentData) ? window.navigator.userAgentData : undefined;
|
||||
var _navigator = (typeof window !== UNDEF_TYPE && window.navigator) ? window.navigator : undefined;
|
||||
var _ua = ua || ((_navigator && _navigator.userAgent) ? _navigator.userAgent : EMPTY);
|
||||
var _uach = (_navigator && _navigator.userAgentData) ? _navigator.userAgentData : undefined;
|
||||
var _rgxmap = extensions ? extend(regexes, extensions) : regexes;
|
||||
var _isSelfNav = _navigator && _navigator.userAgent == _ua;
|
||||
|
||||
this.getBrowser = function () {
|
||||
var _browser = {};
|
||||
_browser[NAME] = undefined;
|
||||
_browser[VERSION] = undefined;
|
||||
rgxMapper.call(_browser, _ua, _rgxmap.browser);
|
||||
_browser.major = majorize(_browser.version);
|
||||
_browser[MAJOR] = majorize(_browser[VERSION]);
|
||||
// Brave-specific detection
|
||||
if (_isSelfNav && _navigator && _navigator.brave && typeof _navigator.brave.isBrave == FUNC_TYPE) {
|
||||
_browser[NAME] = 'Brave';
|
||||
}
|
||||
return _browser;
|
||||
};
|
||||
this.getCPU = function () {
|
||||
@@ -810,9 +829,14 @@
|
||||
_device[MODEL] = undefined;
|
||||
_device[TYPE] = undefined;
|
||||
rgxMapper.call(_device, _ua, _rgxmap.device);
|
||||
if (!_device[TYPE] && _uach && _uach.mobile) {
|
||||
if (_isSelfNav && !_device[TYPE] && _uach && _uach.mobile) {
|
||||
_device[TYPE] = MOBILE;
|
||||
}
|
||||
// iPadOS-specific detection: identified as Mac, but has some iOS-only properties
|
||||
if (_isSelfNav && _device[MODEL] == 'Macintosh' && _navigator && typeof _navigator.standalone !== UNDEF_TYPE && _navigator.maxTouchPoints && _navigator.maxTouchPoints > 2) {
|
||||
_device[MODEL] = 'iPad';
|
||||
_device[TYPE] = TABLET;
|
||||
}
|
||||
return _device;
|
||||
};
|
||||
this.getEngine = function () {
|
||||
@@ -827,8 +851,10 @@
|
||||
_os[NAME] = undefined;
|
||||
_os[VERSION] = undefined;
|
||||
rgxMapper.call(_os, _ua, _rgxmap.os);
|
||||
if (!_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
||||
_os[NAME] = _uach.platform.replace(/chrome/i, 'Chromium').replace(/mac/i, 'Mac ');
|
||||
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
|
||||
_os[NAME] = _uach.platform
|
||||
.replace(/chrome os/i, CHROMIUM_OS)
|
||||
.replace(/macos/i, MAC_OS); // backward compatibility
|
||||
}
|
||||
return _os;
|
||||
};
|
||||
|
||||
@@ -1298,6 +1298,16 @@
|
||||
"major" : "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Yandex",
|
||||
"ua" : "Mozilla/5.0 (Linux; arm_64; Android 11; M2101K7AG) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.125 YaApp_Android/22.70 YaSearchBrowser/22.70 BroPP/1.0 SA/3 Mobile Safari/537.36",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "Yandex",
|
||||
"version" : "22.70",
|
||||
"major" : "22"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Puffin",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 6.0.1; Lenovo P2a42 Build/MMB29M; en-us) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Mobile Safari/537.36 Puffin/6.0.8.15804AP",
|
||||
@@ -1682,5 +1692,32 @@
|
||||
"version": "10.25.0",
|
||||
"major" : "10"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "TikTok",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 11; 21061119AG Build/RP1A.200720.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/92.0.4515.131 Mobile Safari/537.36 trill_2022109040 JsSdk/1.0 NetType/MOBILE Channel/googleplay AppName/musical_ly app_version/21.9.4 ByteLocale/ru-RU ByteFullLocale/ru-RU Region/KG BytedanceWebview/d8a21c6",
|
||||
"expect" : {
|
||||
"name" : "TikTok",
|
||||
"version": "21.9.4",
|
||||
"major" : "21"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "TikTok",
|
||||
"ua" : "Mozilla/5.0 (iPhone; CPU iPhone OS 14_8 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 musical_ly_21.1.0 JsSdk/2.0 NetType/4G Channel/App Store ByteLocale/ru Region/RU ByteFullLocale/ru-RU isDarkMode/1 WKWebView/1 BytedanceWebview/d8a21c6",
|
||||
"expect" : {
|
||||
"name" : "TikTok",
|
||||
"version": "21.1.0",
|
||||
"major" : "21"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "TikTok",
|
||||
"ua" : "Mozilla/5.0 (Linux; Android 10; STK-LX1 Build/HONORSTK-LX1; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/110.0.5481.153 Mobile Safari/537.36 musical_ly_2022803040 JsSdk/1.0 NetType/WIFI Channel/huaweiadsglobal_int AppName/musical_ly app_version/28.3.4 ByteLocale/en ByteFullLocale/en Region/IQ Spark/1.2.7-alpha.8 AppVersion/28.3.4 PIA/1.5.11 BytedanceWebview/d8a21c6",
|
||||
"expect" : {
|
||||
"name" : "TikTok",
|
||||
"version": "28.3.4",
|
||||
"major" : "28"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -763,6 +763,15 @@
|
||||
"type": "undefined"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Apple Watch",
|
||||
"ua": "atc/1.0 watchOS/7.3.3 model/Watch4,2 hwp/t8006 build/18S830 (6; dt:191)",
|
||||
"expect": {
|
||||
"vendor": "Apple",
|
||||
"model": "watch",
|
||||
"type": "wearable"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
@@ -1629,6 +1638,33 @@
|
||||
"type": "tablet"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Echo Show 5",
|
||||
"ua": "Mozilla/5.0 (Linux; Android 5.1; AEORK Build/LVY48F; xx-xx) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.110 Mobile Safari/537.36",
|
||||
"expect": {
|
||||
"vendor": "Amazon",
|
||||
"model": "AEORK",
|
||||
"type": "tablet"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Echo Show 8",
|
||||
"ua": "Mozilla/5.0 (Linux; Android 7.1; AEOCH) AppleWebKit/537.36 (KHTML, like Gecko) Silk/77.2.21 like Chrome/77.0.3865.92 Mobile Safari/537.36",
|
||||
"expect": {
|
||||
"vendor": "Amazon",
|
||||
"model": "AEOCH",
|
||||
"type": "tablet"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Echo Dot",
|
||||
"ua": "Dalvik/2.1.0 (Linux; U; Android 5.1.1; AEOBC Build/LVY48F)",
|
||||
"expect": {
|
||||
"vendor": "Amazon",
|
||||
"model": "AEOBC",
|
||||
"type": "embedded"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Samsung Galaxy A21s",
|
||||
"ua": "Mozilla/5.0 (Linux; Android 10; SAMSUNG SM-A217F) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/11.0 Chrome/75.0.3770.143 Mobile Safari/537.36",
|
||||
@@ -3100,6 +3136,17 @@
|
||||
"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]",
|
||||
"expect": {
|
||||
"vendor": "Apple",
|
||||
"model": "iPhone12,1",
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "Issue #519",
|
||||
"ua": "ios/iPhone/14.2/SOME_CUSTOM_APP_VERSION",
|
||||
"expect": {
|
||||
"vendor": "Apple",
|
||||
"model": "iPhone",
|
||||
"type": "mobile"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -53,6 +53,15 @@
|
||||
"version" : "4.5.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "LibWeb",
|
||||
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "LibWeb",
|
||||
"version" : "undefined"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "NetFront",
|
||||
"ua" : "Mozilla/4.0 (PDA; Windows CE/1.0.1) NetFront/3.0",
|
||||
|
||||
@@ -764,6 +764,42 @@
|
||||
"version" : "undefined"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc": "iOS with 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]",
|
||||
"expect":
|
||||
{
|
||||
"name" : "iOS",
|
||||
"version" : "13.6.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "watchOS",
|
||||
"ua" : "server-bag [Watch OS,8.4,19S546,Watch3,4]",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "watchOS",
|
||||
"version" : "8.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "watchOS",
|
||||
"ua" : "atc/1.0 watchOS/7.4.1 model/Watch3,3 hwp/t8004 build/18T201 (6; dt:155)",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "watchOS",
|
||||
"version" : "7.4.1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "watchOS",
|
||||
"ua" : "Watch4,3/5.3.8 (16U680)",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "watchOS",
|
||||
"version" : "5.3.8"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "Mac OS on PowerPC",
|
||||
"ua" : "Mozilla/4.0 (compatible; MSIE 5.0b1; Mac_PowerPC)",
|
||||
@@ -1168,5 +1204,14 @@
|
||||
"name" : "Linspire",
|
||||
"version" : "1.5.0.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
"desc" : "SerenityOS",
|
||||
"ua" : "Mozilla/4.0 (SerenityOS; x86) LibWeb+LibJS (Not KHTML, nor Gecko) LibWeb",
|
||||
"expect" :
|
||||
{
|
||||
"name" : "SerenityOS",
|
||||
"version" : "undefined"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user