Skip to content

Commit

Permalink
Bump version 1.0.38 (mirror of 0.7.38)
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalman committed May 28, 2024
2 parents 8087a1b + cede701 commit 693a83d
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 15 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.37",
"version": "1.0.38",
"authors": [
"Faisal Salman <f@faisalman.com>"
],
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

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.38 / 1.0.38
- Fix error on getOS() when userAgentData.platform is undefined
- Add new browser: Opera GX, Twitter
- Improve browser detection: DuckDuckGo
- Improve device detection: OPPO Pad, Oculus Quest

## Version 0.7.37 / 1.0.37
- Fix misidentified WebView token as device model
- Increase UA_MAX_LENGTH to 500
Expand Down
4 changes: 2 additions & 2 deletions dist/ua-parser.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 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.37',
version: '1.0.38',
summary: 'Lightweight JavaScript-based user-agent string parser',
git: 'https://github.com/faisalman/ua-parser-js.git',
documentation: 'readme.md'
Expand Down
2 changes: 1 addition & 1 deletion 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.37",
"version": "1.0.38",
"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
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ 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,
Oculus Browser, OmniWeb, Opera Coast, Opera [Mini/Mobi/Tablet], PaleMoon,
Oculus Browser, OmniWeb, Opera Coast, Opera [GX/Mini/Mobi/Tablet], PaleMoon,
PhantomJS, Phoenix, Polaris, Puffin, QQ, QQBrowser, QQBrowserLite, Quark,
QupZilla, RockMelt, Safari, Sailfish Browser, Samsung Internet, SeaMonkey, Silk,
Skyfire, Sleipnir, Slim, SlimBrowser, Smart Lenovo Browser, Snapchat,
Sogou [Explorer/Mobile], Swiftfox, Tesla, TikTok, Tizen Browser, UCBrowser,
UP.Browser, Viera, Vivaldi, Vivo Browser, Waterfox, WeChat, Weibo, Yandex, w3m,
Whale Browser, ...
Sogou [Explorer/Mobile], Swiftfox, Tesla, TikTok, Tizen Browser, Twitter,
UCBrowser, UP.Browser, Viera, Vivaldi, Vivo Browser, Waterfox, WeChat, Weibo,
Yandex, w3m, Whale Browser, ...

# 'browser.version' determined dynamically
```
Expand Down
15 changes: 11 additions & 4 deletions src/ua-parser.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////////
/* UAParser.js v1.0.37
/* UAParser.js v1.0.38
Copyright © 2012-2021 Faisal Salman <f@faisalman.com>
MIT License *//*
Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data.
Expand All @@ -17,7 +17,7 @@
/////////////


var LIBVERSION = '1.0.37',
var LIBVERSION = '1.0.38',
EMPTY = '',
UNKNOWN = '?',
FUNC_TYPE = 'function',
Expand Down Expand Up @@ -223,6 +223,8 @@
], [NAME, VERSION], [
/opios[\/ ]+([\w\.]+)/i // Opera mini on iphone >= 8.0
], [VERSION, [NAME, OPERA+' Mini']], [
/\bop(?:rg)?x\/([\w\.]+)/i // Opera GX
], [VERSION, [NAME, OPERA+' GX']], [
/\bopr\/([\w\.]+)/i // Opera Webkit
], [VERSION, [NAME, OPERA]], [

Expand All @@ -241,6 +243,8 @@
/(heytap|ovi)browser\/([\d\.]+)/i, // Heytap/Ovi
/(weibo)__([\d\.]+)/i // Weibo
], [NAME, VERSION], [
/\bddg\/([\w\.]+)/i // DuckDuckGo
], [VERSION, [NAME, 'DuckDuckGo']], [
/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i // UCBrowser
], [VERSION, [NAME, 'UC'+BROWSER]], [
/microm.+\bqbcore\/([\w\.]+)/i, // WeChat Desktop for Windows Built-in Browser
Expand Down Expand Up @@ -300,6 +304,7 @@
/safari (line)\/([\w\.]+)/i, // Line App for iOS
/\b(line)\/([\w\.]+)\/iab/i, // Line App for Android
/(alipay)client\/([\w\.]+)/i, // Alipay
/(twitter)(?:and| f.+e\/([\w\.]+))/i, // Twitter
/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i // Chromium/Instagram/Snapchat
], [NAME, VERSION], [
/\bgsa\/([\w\.]+) .*safari\//i // Google Search Appliance on iOS
Expand Down Expand Up @@ -437,6 +442,8 @@
/; (\w+) bui.+ oppo/i,
/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i
], [MODEL, [VENDOR, 'OPPO'], [TYPE, MOBILE]], [
/\b(opd2\d{3}a?) bui/i
], [MODEL, [VENDOR, 'OPPO'], [TYPE, TABLET]], [

// Vivo
/vivo (\w+)(?: bui|\))/i,
Expand Down Expand Up @@ -673,7 +680,7 @@
], [MODEL, [VENDOR, GOOGLE], [TYPE, WEARABLE]], [
/droid.+; (wt63?0{2,3})\)/i
], [MODEL, [VENDOR, ZEBRA], [TYPE, WEARABLE]], [
/(quest( 2| pro)?)/i // Oculus Quest
/(quest( \d| pro)?)/i // Oculus Quest
], [MODEL, [VENDOR, FACEBOOK], [TYPE, WEARABLE]], [

///////////////////
Expand Down Expand Up @@ -865,7 +872,7 @@
_os[NAME] = undefined;
_os[VERSION] = undefined;
rgxMapper.call(_os, _ua, _rgxmap.os);
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform != 'Unknown') {
if (_isSelfNav && !_os[NAME] && _uach && _uach.platform && _uach.platform != 'Unknown') {
_os[NAME] = _uach.platform
.replace(/chrome os/i, CHROMIUM_OS)
.replace(/macos/i, MAC_OS); // backward compatibility
Expand Down
50 changes: 50 additions & 0 deletions test/browser-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,16 @@
"major" : "1"
}
},
{
"desc" : "DuckDuckGo",
"ua" : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4.1 Safari/605.1.1517.4.1 Ddg/17.4.1",
"expect" :
{
"name" : "DuckDuckGo",
"version" : "17.4.1",
"major" : "17"
}
},
{
"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",
Expand Down Expand Up @@ -1118,6 +1128,26 @@
"major" : "12"
}
},
{
"desc" : "Opera GX on Android",
"ua" : "Mozilla/5.0 (Linux; Android 10; Redmi Note 8 Pro Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.5790.168 Mobile Safari/537.36 OPX/2",
"expect" :
{
"name" : "Opera GX",
"version" : "2",
"major" : "2"
}
},
{
"desc" : "Opera GX on Windows",
"ua" : "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.50747 OPRGX/60.0.3255.50747",
"expect" :
{
"name" : "Opera GX",
"version" : "60.0.3255.50747",
"major" : "60"
}
},
{
"desc" : "Opera Tablet",
"ua" : "Opera/9.80 (Windows NT 6.1; Opera Tablet/15165; U; en) Presto/2.8.149 Version/11.1",
Expand Down Expand Up @@ -2011,5 +2041,25 @@
"version" : "12.33.0.36",
"major" : "12"
}
},
{
"desc" : "Twitter",
"ua" : "Mozilla/5.0 (Linux; Android 13; CPH2531 Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/123.0.6312.120 Mobile Safari/537.36 TwitterAndroid",
"expect" :
{
"name" : "Twitter",
"version" : "undefined",
"major" : "undefined"
}
},
{
"desc" : "Twitter",
"ua" : "Mozilla/5.0 (iPad; CPU OS 15_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/19H12 Twitter for iPhone/10.34",
"expect" :
{
"name" : "Twitter",
"version" : "10.34",
"major" : "10"
}
}
]
18 changes: 18 additions & 0 deletions test/device-test.json
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,15 @@
"type": "wearable"
}
},
{
"desc": "Oculus Quest 3",
"ua": "Mozilla/5.0 (X11; Linux x86_64; Quest 3) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/31.4.0.6.51.566757996 Chrome/120.0.6099.283 VR Safari/537.36",
"expect": {
"vendor": "Facebook",
"model": "Quest 3",
"type": "wearable"
}
},
{
"desc": "Oculus Quest Pro",
"ua": "Mozilla/5.0 (X11; Linux x86_64; Quest Pro) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/24.4.0.22.60.426469926 SamsungBrowser/4.0 Chrome/106.0.5249.181 VR Safari/537.36",
Expand Down Expand Up @@ -1493,6 +1502,15 @@
"type": "mobile"
}
},
{
"desc": "OPPO Pad",
"ua": "Mozilla/5.0 (Linux; U; Android 13; zh-CN; OPD2101 Build/TP1A.220905.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.58 UCBrowser/16.3.9.1290 Mobile Safari/537.36",
"expect": {
"vendor": "OPPO",
"model": "OPD2101",
"type": "tablet"
}
},
{
"desc": "OPPO Neo",
"ua": "Mozilla/5.0 (Linux; U; Android 4.2.2; zh-cn; R831T Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 OppoBrowser/3.3.2 Mobile Safari/534.30",
Expand Down

0 comments on commit 693a83d

Please # to comment.