Skip to content

Commit 7bc177d

Browse files
committed
Bump version 2.0.7
1 parent 82d5045 commit 7bc177d

19 files changed

+348
-265
lines changed

CHANGELOG.md

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,52 @@
5454
- `browser.name`, `browser.type`, `cpu.architecture`, `device.type`, `device.vendor`, `engine.name`, `os.name`
5555

5656
- **`'ua-parser-js/extensions'`**: Predefined extensions for various use cases:
57-
- `Bots`, `Crawlers`, `CLIs`, `Emails`, `ExtraDevices`, `Fetchers`, `InApps`, `Libraries`, `Mediaplayers`
57+
- `Bots`, `Crawlers`, `CLIs`, `Emails`, `ExtraDevices`, `Fetchers`, `InApps`, `Libraries`, `Mediaplayers`, `Vehicles`
5858

5959
- **`'ua-parser-js/helpers'`**: Provides utility methods to extend detection functionality:
60-
- `getDeviceVendor()`: Guesses the device vendor based on its model name
61-
- `isAppleSilicon()`: Detects Apple Silicon device properties
62-
- `isAIBot()`: Checks if the user-agent is an AI bot
60+
- `isFrozenUA()`: Checks if the user-agent matches a frozen/reduced user-agent pattern
61+
62+
- **`'ua-parser-js/bot-detection'`**:
63+
- `isAIAssistant()`: Checks if the user-agent is an AI assistant
64+
- `isAICrawler()`: Checks if the user-agent is an AI crawler
6365
- `isBot()`: Checks if the user-agent is a bot
66+
67+
- **`'ua-parser-js/browser-detection'`**:
6468
- `isChromeFamily()`: Checks if the browser is Chrome-based (uses Blink engine) — e.g., New Opera, New Edge, Vivaldi, Brave, Arc, etc.
6569
- `isElectron()`: Detects if current window is running within Electron
6670
- `isFromEU()`: Detects if current browser's timezone is from an EU country
67-
- `isFrozenUA()`: Checks if the user-agent matches a frozen/reduced user-agent pattern
6871
- `isStandalonePWA()`: Detects if current window is a standalone PWA
6972

73+
- **`'ua-parser-js/device-detection'`**:
74+
- `getDeviceVendor()`: Guesses the device vendor based on its model name
75+
- `isAppleSilicon()`: Detects Apple Silicon device properties
76+
7077
---
7178

79+
## Version 2.0.7
80+
81+
- Add support for chaining `withClientHints()` & `withFeatureCheck()`
82+
- Add new browser: Atlas, Steam
83+
- Add new device vendor: Anbernic, Logitech, Valve
84+
- Improve device detection: Xiaomi
85+
- Improve OS detection: iOS
86+
- Split `helpers` submodule into several new submodules:
87+
- `bot-detection`:
88+
- `isAIAssistant()`
89+
- `isAICrawler()`
90+
- `isBot()`
91+
- `browser-detection`
92+
- `isChromeFamily()`
93+
- `isElectron()`
94+
- `isFromEU()`
95+
- `isStandalonePWA()`
96+
- `device-detection`
97+
- `getDeviceVendor()`
98+
- `isAppleSilicon()`
99+
- Update `extensions` submodule:
100+
- Add new fetcher: Nova Act
101+
- Add new library: Bun, Dart, Deno, hackney, Node.js, rest-client, undici
102+
72103
## Version 2.0.6
73104
- Add new CLI feature: processing batch user-agent data from file and output as JSON
74105
- Fix `setUA()`: trim leading space from user-agent string input

dist/ua-parser.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ua-parser.min.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/ua-parser.pack.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ua-parser.pack.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "UAParser.js",
33
"name": "ua-parser-js",
4-
"version": "2.0.6",
4+
"version": "2.0.7",
55
"author": "Faisal Salman <[email protected]> (http://faisalman.com)",
66
"description": "Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent & Client Hints data. Supports browser & node.js environment",
77
"keywords": [
@@ -246,7 +246,7 @@
246246
"devDependencies": {
247247
"@babel/parser": "7.15.8",
248248
"@babel/traverse": "7.23.2",
249-
"@playwright/test": "^1.49.0",
249+
"@playwright/test": "^1.57.0",
250250
"jshint": "~2.13.6",
251251
"mocha": "~8.2.0",
252252
"requirejs": "2.3.2",

src/bot-detection/bot-detection.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
/*jshint esversion: 6 */
1313

1414
import { UAParser } from '../main/ua-parser.mjs';
15-
import { Extension, BrowserType } from '../enums/ua-parser-enums.mjs';
1615
import { Bots, Crawlers, Fetchers } from '../extensions/ua-parser-extensions.mjs';
16+
import { BrowserType, Extension } from '../enums/ua-parser-enums.mjs';
1717
const { Crawler, Fetcher } = Extension.BrowserName;
1818

1919
class BotList {
@@ -40,6 +40,9 @@ const BotTypes = new BotList(Bots, 'type', [
4040

4141
const AIAssistants = new BotList(Fetchers, 'name', [
4242

43+
// Amazon
44+
Fetcher.AMAZON_NOVA_ACT,
45+
4346
// Anthropic
4447
Fetcher.ANTHROPIC_CLAUDE_USER,
4548

src/browser-detection/browser-detection.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@
1212
/*jshint esversion: 6 */
1313

1414
import { UAParser } from '../main/ua-parser.mjs';
15+
import { EngineName } from '../enums/ua-parser-enums.mjs';
1516
import { isStandalonePWA } from 'is-standalone-pwa';
17+
import { isFromEU } from 'detect-europe-js';
1618

1719
const isChromeFamily = val => !!(
1820
(typeof val === 'string' ?
1921
new UAParser(val).getEngine() :
2022
val.engine
2123
)?.is(EngineName.BLINK));
2224

23-
const isElectron = () => !!(process?.versions?.hasOwnProperty('electron') || // node.js
24-
/ electron\//i.test(navigator?.userAgent)); // browser
25+
const isElectron = () => !!(
26+
process?.versions?.hasOwnProperty('electron') || // node.js
27+
/ electron\//i.test(navigator?.userAgent)); // browser
2528

2629
export {
2730
isChromeFamily,
2831
isElectron,
32+
isFromEU,
2933
isStandalonePWA
3034
}

src/enums/ua-parser-enums.d.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Source: /src/enums/ua-parser-enums.js
44

55
///////////////////////////////////////////////
6-
/* Enums for UAParser.js v2.0.6
6+
/* Enums for UAParser.js v2.0.7
77
https://github.com/faisalman/ua-parser-js
88
Author: Faisal Salman <[email protected]>
99
AGPLv3 License */
@@ -19,6 +19,7 @@ export const BrowserName: Readonly<{
1919
AMAYA: 'Amaya',
2020
ANDROID: 'Android Browser',
2121
ARORA: 'Arora',
22+
ATLAS: 'Atlas',
2223
AVANT: 'Avant',
2324
AVAST: 'Avast Secure Browser',
2425
AVG: 'AVG Secure Browser',
@@ -147,6 +148,7 @@ export const BrowserName: Readonly<{
147148
SNAPCHAT: 'Snapchat',
148149
SOGOU_EXPLORER: 'Sogou Explorer',
149150
SOGOU_MOBILE: 'Sogou Mobile',
151+
STEAM: 'Steam',
150152
SURF: 'Surf',
151153
SWIFTFOX: 'Swiftfox',
152154
TESLA: 'Tesla',
@@ -228,8 +230,9 @@ export const DeviceVendor: Readonly<{
228230
ACER: 'Acer',
229231
ADVAN: 'Advan',
230232
ALCATEL: 'Alcatel',
231-
APPLE: 'Apple',
232233
AMAZON: 'Amazon',
234+
ANBERNIC: 'Anbernic',
235+
APPLE: 'Apple',
233236
ARCHOS: 'Archos',
234237
ASUS: 'ASUS',
235238
ATT: 'AT&T',
@@ -258,6 +261,7 @@ export const DeviceVendor: Readonly<{
258261
LAVA: 'Lava',
259262
LENOVO: 'Lenovo',
260263
LG: 'LG',
264+
LOGITECH: 'Logitech',
261265
MEIZU: 'Meizu',
262266
MICROMAX: 'Micromax',
263267
MICROSOFT: 'Microsoft',
@@ -291,6 +295,7 @@ export const DeviceVendor: Readonly<{
291295
TECNO: 'TECNO',
292296
TESLA: 'Tesla',
293297
ULEFONE: 'Ulefone',
298+
VALVE: 'Valve',
294299
VIVO: 'Vivo',
295300
VIZIO: 'Vizio',
296301
VODAFONE: 'Vodafone',
@@ -631,6 +636,7 @@ export const Extension: Readonly<{
631636
},
632637
Fetcher: {
633638
AHREFS_SITEAUDIT: 'AhrefsSiteAudit',
639+
AMAZON_NOVA_ACT: 'NovaAct',
634640
ANTHROPIC_CLAUDE_USER: 'Claude-User',
635641
ASANA: 'Asana',
636642
BETTER_UPTIME_BOT: 'Better Uptime Bot',
@@ -708,26 +714,33 @@ export const Extension: Readonly<{
708714
AIOHTTP: 'aiohttp',
709715
APACHE_HTTPCLIENT: 'Apache-HttpClient',
710716
AXIOS: 'axios',
717+
BUN: 'Bun',
718+
DART: 'Dart',
719+
DENO: 'Deno',
711720
GO_HTTP_CLIENT: 'go-http-client',
712721
GOT: 'got',
713722
GUZZLEHTTP: 'GuzzleHttp',
723+
HACKNEY: 'hackney',
714724
JAVA: 'Java',
715725
JAVA_HTTPCLIENT: 'Java-http-client',
716726
JSDOM: 'jsdom',
717727
LIBWWW_PERL: 'libwww-perl',
718728
LUA_RESTY_HTTP: 'lua-resty-http',
719729
NEEDLE: 'Needle',
720730
NUTCH: 'Nutch',
721-
OKHTTP: 'OkHttp',
722731
NODE_FETCH: 'node-fetch',
732+
NODE_JS: 'Node.js',
723733
NODE_SUPERAGENT: 'node-superagent',
734+
OKHTTP: 'OkHttp',
724735
PHP_SOAP: 'PHP-SOAP',
725736
POSTMAN_RUNTIME: 'PostmanRuntime',
726737
PYTHON_HTTPX: 'python-httpx',
727738
PYTHON_URLLIB: 'python-urllib',
728739
PYTHON_URLLIB3: 'python-urllib3',
729740
PYTHON_REQUESTS: 'python-requests',
730-
SCRAPY: 'Scrapy'
741+
REST_CLIENT: 'rest-client',
742+
SCRAPY: 'Scrapy',
743+
UNDICI: 'undici'
731744
}
732745
},
733746
DeviceVendor: {

0 commit comments

Comments
 (0)