Skip to content

Commit

Permalink
Bump v1.0.40 (mirror of v0.7.40)
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed Dec 21, 2024
2 parents 8b1db6b + 5c811b8 commit f5a421c
Show file tree
Hide file tree
Showing 12 changed files with 577 additions and 73 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ua-parser-js",
"version": "1.0.39",
"version": "1.0.40",
"authors": [
"Faisal Salman <f@faisalman.com>"
],
Expand Down
9 changes: 9 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

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.40 / 1.0.40
- Add new browser: 115, LibreWolf, Slimboat, Slimjet
- Add new device: Advan, Cat, Energizer, IMO, Micromax, Smartfren
- Add new engine: ArkWeb, Servo
- Add new os: OpenHarmony
- Improve browser detection: 2345, 360, Dragon, Iron, Maxthon
- Recognize Honor as a separate device vendor from Huawei
- Fix Python Request mistakenly identified as Meta Quest

## Version 0.7.39 / 1.0.39
- Add new feature: executable command using `npx ua-parser-js "[INSERT-UA-HERE]"`
- Add new browser: Helio, Pico Browser, Wolvic
Expand Down
6 changes: 3 additions & 3 deletions dist/ua-parser.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/ua-parser.pack.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'faisalman:ua-parser-js',
version: '1.0.39',
version: '1.0.40',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "UAParser.js",
"name": "ua-parser-js",
"version": "1.0.39",
"version": "1.0.40",
"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": [
Expand Down Expand Up @@ -206,8 +206,8 @@
"url": "https://paypal.me/faisalman"
},
{
"type": "github",
"url": "https://github.com/sponsors/faisalman"
"type": "github",
"url": "https://github.com/sponsors/faisalman"
}
]
}
39 changes: 20 additions & 19 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ JavaScript library to detect Browser, Engine, OS, CPU, and Device type/model fro
* Demo : https://uaparser.dev
* Source : https://github.com/faisalman/ua-parser-js
* Documentation :
* v1 : https://github.com/faisalman/ua-parser-js/tree/1.0.39#documentation
* v1 : https://github.com/faisalman/ua-parser-js/tree/1.0.x#documentation
* v2 : https://docs.uaparser.dev

***
Expand Down Expand Up @@ -100,20 +100,20 @@ The methods are self explanatory, here's a small overview on all the available m

```sh
# Possible 'browser.name':
2345Explorer, 360 Browser, Alipay, Amaya, Android Browser, Arora, Avant, Avast,
AVG, Baidu, Basilisk, Blazer, Bolt, Brave, Bowser, Camino, Chimera,
115 Browser, 2345Explorer, 360 Browser, Alipay, Amaya, Android Browser, Arora,
Avant, Avast, AVG, 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, Helio, Heytap,
Huawei Browser, iCab, ICE Browser, IE, IEMobile, IceApe, IceCat, IceDragon,
Iceweasel, Instagram, Iridium, Iron, Jasmine, Kakao[Story/Talk], K-Meleon,
Kindle, Klar, Klarna, Konqueror, LBBROWSER, Line, LinkedIn, Links, Lunascape,
Lynx, MIUI Browser, Maemo, Maxthon, Midori, Minimo, Mobile Safari, Mosaic,
Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Obigo,
Kindle, Klar, Klarna, Konqueror, LBBROWSER, LibreWolf, Line, LinkedIn, Links,
Lunascape, Lynx, MIUI Browser, Maemo, Maxthon, Midori, Minimo, Mobile Safari,
Mosaic, Mozilla, NetFront, NetSurf, Netfront, Netscape, NokiaBrowser, Obigo,
Oculus Browser, OmniWeb, Opera Coast, Opera [GX/Mini/Mobi/Tablet], PaleMoon,
PhantomJS, Phoenix, Pico Browser, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite,
Quark, QupZilla, RockMelt, Safari, Sailfish Browser, Samsung Internet, SeaMonkey,
Silk, Skyfire, Sleipnir, Slim, SlimBrowser, Smart Lenovo Browser, Snapchat,
Silk, Skyfire, Sleipnir, Slim[Browser/Boat/Jet], Smart Lenovo Browser, Snapchat,
Sogou [Explorer/Mobile], Swiftfox, Tesla, TikTok, Tizen Browser, Twitter,
UCBrowser, UP.Browser, Vivaldi, Vivo Browser, w3m, Waterfox, WeChat, Weibo,
Whale Browser, Wolvic, Yandex, ...
Expand All @@ -136,12 +136,13 @@ console, mobile, tablet, smarttv, wearable, embedded
##########

# Possible 'device.vendor':
Acer, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Dell,
Essential, Facebook, Fairphone, GeeksPhone, Google, HP, HTC, Huawei, Infinix,
itel, Jolla, Kobo, Lenovo, LG, Meizu, Microsoft, Motorola, Nexian, Nintendo,
Nokia, Nothing, Nvidia, OnePlus, OPPO, Ouya, Palm, Panasonic, Pebble, Polytron,
Realme, RIM, Roku, Samsung, Sharp, Siemens, Sony[Ericsson], Sprint, TCL, Tecno,
Tesla, Ulefone, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...
Acer, Advan, Alcatel, Amazon, Apple, Archos, ASUS, AT&T, BenQ, BlackBerry, Cat,
Dell, Energizer, Essential, Facebook, Fairphone, GeeksPhone, Google, HP, HTC,
Huawei, IMO, Infinix, itel, Jolla, Kobo, Lenovo, LG, Meizu, Micromax, Microsoft,
Motorola, Nexian, Nintendo, Nokia, Nothing, Nvidia, OnePlus, OPPO, Ouya, Palm,
Panasonic, Pebble, Polytron, Realme, RIM, Roku, Samsung, Sharp, Siemens,
Smartfren, Sony[Ericsson], Sprint, TCL, Tecno, Tesla, Ulefone, Vivo, Vodafone,
Xbox, Xiaomi, Zebra, ZTE, ...

# 'device.model' determined dynamically
```
Expand All @@ -151,8 +152,8 @@ Tesla, Ulefone, Vivo, Vodafone, Xbox, Xiaomi, Zebra, ZTE, ...

```sh
# Possible 'engine.name'
Amaya, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, LibWeb, Links, Lynx,
NetFront, NetSurf, Presto, Tasman, Trident, w3m, WebKit
Amaya, ArkWeb, Blink, EdgeHTML, Flow, Gecko, Goanna, iCab, KHTML, LibWeb, Links,
Lynx, NetFront, NetSurf, Presto, Servo, Tasman, Trident, w3m, WebKit

# 'engine.version' determined dynamically
```
Expand All @@ -166,10 +167,10 @@ AIX, Amiga OS, Android[-x86], Arch, Bada, BeOS, BlackBerry, CentOS, Chromium OS,
Contiki, Fedora, Firefox OS, FreeBSD, Debian, Deepin, DragonFly, elementary OS,
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, SerenityOS, Series40, Slackware, Solaris, SUSE,
Symbian, Tizen, Ubuntu, Unix, VectorLinux, Viera, watchOS, WebOS,
Mint, Morph OS, NetBSD, NetRange, NetTV, Nintendo, OpenBSD, OpenHarmony, OpenVMS,
OS/2, Palm, PC-BSD, PCLinuxOS, Plan9, PlayStation, QNX, Raspbian, RedHat,
RIM Tablet OS, 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
Expand Down
83 changes: 59 additions & 24 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v1.0.39
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
/* UAParser.js v1.0.40
Copyright © 2012-2024 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Supports browser & node.js environment.
Expand All @@ -17,7 +17,7 @@
/////////////


var LIBVERSION = '1.0.39',
var LIBVERSION = '1.0.40',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
Expand Down Expand Up @@ -232,17 +232,19 @@
// Mixed
/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i // Baidu
], [VERSION, [NAME, 'Baidu']], [
/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i // Maxthon
], [VERSION, [NAME, 'Maxthon']], [
/(kindle)\/([\w\.]+)/i, // Kindle
/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,
// Lunascape/Maxthon/Netfront/Jasmine/Blazer/Sleipnir
// Trident based
/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser
/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i, // Avant/IEMobile/SlimBrowser/SlimBoat/Slimjet
/(?: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|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio
/(heytap|ovi)browser\/([\d\.]+)/i, // HeyTap/Ovi
// Blink/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|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,
// Rekonq/Puffin/Brave/Whale/QQBrowserLite/QQ//Vivaldi/DuckDuckGo/Klar/Helio/Dragon
/(heytap|ovi|115)browser\/([\d\.]+)/i, // HeyTap/Ovi/115
/(weibo)__([\d\.]+)/i // Weibo
], [NAME, VERSION], [
/quark(?:pc)?\/([-\w\.]+)/i // Quark
Expand Down Expand Up @@ -276,30 +278,31 @@
/coast\/([\w\.]+)/i // Opera Coast
], [VERSION, [NAME, OPERA+' Coast']], [
/miuibrowser\/([\w\.]+)/i // MIUI Browser
], [VERSION, [NAME, 'MIUI '+BROWSER]], [
/fxios\/([-\w\.]+)/i // Firefox for iOS
], [VERSION, [NAME, 'MIUI' + SUFFIX_BROWSER]], [
/fxios\/([\w\.-]+)/i // Firefox for iOS
], [VERSION, [NAME, FIREFOX]], [
/\bqihu|(qi?ho?o?|360)browser/i // 360
], [[NAME, '360' + SUFFIX_BROWSER]], [
/\bqihoobrowser\/?([\w\.]*)/i // 360
], [VERSION, [NAME, '360']], [
/\b(qq)\/([\w\.]+)/i // QQ
], [[NAME, /(.+)/, '$1Browser'], VERSION], [
/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i
], [[NAME, /(.+)/, '$1' + SUFFIX_BROWSER], VERSION], [ // Oculus/Sailfish/HuaweiBrowser/VivoBrowser/PicoBrowser
/samsungbrowser\/([\w\.]+)/i // Samsung Internet
], [VERSION, [NAME, SAMSUNG + ' Internet']], [
/(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon
], [[NAME, /_/g, ' '], VERSION], [
/metasr[\/ ]?([\d\.]+)/i // Sogou Explorer
], [VERSION, [NAME, 'Sogou Explorer']], [
/(sogou)mo\w+\/([\d\.]+)/i // Sogou Mobile
], [[NAME, 'Sogou Mobile'], VERSION], [
/(electron)\/([\w\.]+) safari/i, // Electron-based App
/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i, // Tesla
/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i // QQBrowser/2345 Browser
/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i // QQ/2345
], [NAME, VERSION], [
/(lbbrowser|rekonq)/i, // LieBao Browser/Rekonq
/\[(linkedin)app\]/i // LinkedIn App for iOS & Android
], [NAME], [
/ome\/([\w\.]+) \w* ?(iron) saf/i, // Iron
/ome\/([\w\.]+).+qihu (360)[es]e/i // 360
], [VERSION, NAME], [

// WebView
/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i // Facebook App for iOS & Android
Expand Down Expand Up @@ -343,7 +346,7 @@
// Gecko based
/(navigator|netscape\d?)\/([-\w\.]+)/i // Netscape
], [[NAME, 'Netscape'], VERSION], [
/(wolvic)\/([\w\.]+)/i // Wolvic
/(wolvic|librewolf)\/([\w\.]+)/i // Wolvic/LibreWolf
], [NAME, VERSION], [
/mobile vr; rv:([\w\.]+)\).+firefox/i // Firefox Reality
], [VERSION, [NAME, FIREFOX+' Reality']], [
Expand Down Expand Up @@ -426,10 +429,14 @@
/\b(sh-?[altvz]?\d\d[a-ekm]?)/i
], [MODEL, [VENDOR, SHARP], [TYPE, MOBILE]], [

// Honor
/(?:honor)([-\w ]+)[;\)]/i
], [MODEL, [VENDOR, 'Honor'], [TYPE, MOBILE]], [

// Huawei
/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i
], [MODEL, [VENDOR, HUAWEI], [TYPE, TABLET]], [
/(?:huawei|honor)([-\w ]+)[;\)]/i,
/(?:huawei)([-\w ]+)[;\)]/i,
/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i
], [MODEL, [VENDOR, HUAWEI], [TYPE, MOBILE]], [

Expand Down Expand Up @@ -494,7 +501,7 @@
], [MODEL, [VENDOR, GOOGLE], [TYPE, MOBILE]], [

// Sony
/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i
], [MODEL, [VENDOR, SONY], [TYPE, MOBILE]], [
/sony tablet [ps]/i,
/\b(?:sony)?sgp\w+(?: bui|\))/i
Expand Down Expand Up @@ -557,13 +564,28 @@
/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i
], [MODEL, [VENDOR, 'Ulefone'], [TYPE, MOBILE]], [

// Energizer
/; (energy ?\w+)(?: bui|\))/i,
/; energizer ([\w ]+)(?: bui|\))/i
], [MODEL, [VENDOR, 'Energizer'], [TYPE, MOBILE]], [

// Cat
/; cat (b35);/i,
/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i
], [MODEL, [VENDOR, 'Cat'], [TYPE, MOBILE]], [

// Smartfren
/((?:new )?andromax[\w- ]+)(?: bui|\))/i
], [MODEL, [VENDOR, 'Smartfren'], [TYPE, MOBILE]], [

// Nothing
/droid.+; (a(?:015|06[35]|142p?))/i
], [MODEL, [VENDOR, 'Nothing'], [TYPE, MOBILE]], [

// MIXED
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron
/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,
// BlackBerry/BenQ/Palm/Sony-Ericsson/Acer/Asus/Dell/Meizu/Motorola/Polytron/Infinix/Tecno/Micromax/Advan
/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i, // IMO
/(hp) ([\w ]+\w)/i, // HP iPAQ
/(asus)-?(\w+)/i, // Asus
/(microsoft); (lumia[\w ]+)/i, // Microsoft Lumia
Expand All @@ -572,6 +594,7 @@
/(oppo) ?([\w ]+) bui/i // OPPO
], [VENDOR, MODEL, [TYPE, MOBILE]], [

/(imo) (tab \w+)/i, // IMO
/(kobo)\s(ereader|touch)/i, // Kobo
/(archos) (gamepad2?)/i, // Archos
/(hp).+(touchpad(?!.+tablet)|tablet)/i, // HP TouchPad
Expand Down Expand Up @@ -701,7 +724,16 @@
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
/droid.+; (wt63?0{2,3})\)/i
], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [
/(quest( \d| pro)?)/i // Oculus Quest

///////////////////
// XR
///////////////////

/droid.+; (glass) \d/i // Google Glass
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
/(pico) (4|neo3(?: link|pro)?)/i // Pico
], [VENDOR, MODEL, [TYPE, WEARABLE]], [
/; (quest( \d| pro)?)/i // Oculus Quest
], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [

///////////////////
Expand Down Expand Up @@ -734,11 +766,14 @@
/windows.+ edge\/([\w\.]+)/i // EdgeHTML
], [VERSION, [NAME, EDGE+'HTML']], [

/(arkweb)\/([\w\.]+)/i // ArkWeb
], [NAME, VERSION], [

/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i // Blink
], [VERSION, [NAME, 'Blink']], [

/(presto)\/([\w\.]+)/i, // Presto
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna
/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m/Goanna/Servo
/ekioh(flow)\/([\w\.]+)/i, // Flow
/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i, // KHTML/Tasman/Links
/(icab)[\/ ]([23]\.[\d\.]+)/i, // iCab
Expand Down Expand Up @@ -772,8 +807,8 @@

// Mobile OSes
/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i // Android-x86/HarmonyOS
], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,
], [VERSION, NAME], [ // Android/WebOS/QNX/Bada/RIM/Maemo/MeeGo/Sailfish OS/OpenHarmony
/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,
/(blackberry)\w*\/([\w\.]*)/i, // Blackberry
/(tizen|kaios)[\/ ]([\w\.]+)/i, // Tizen/KaiOS
/\((series40);/i // Series 40
Expand Down
Loading

0 comments on commit f5a421c

Please sign in to comment.