Skip to content

Commit 74ab14e

Browse files
committed
Merge tag 'tags/2.0.0' into pro-business
2 parents abde14f + 38baf84 commit 74ab14e

23 files changed

+589
-73
lines changed

CHANGELOG.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
- **`'ua-parser-js/helpers'`**: Provides utility methods to extend detection functionality:
5656
- `getDeviceVendor()`: Guesses the device vendor based on its model name
5757
- `isAppleSilicon()`: Detects Apple Silicon device properties
58-
- `isBot()`: Checks if the browser is a bot
58+
- `isAIBot()`: Checks if the user-agent is an AI bot
59+
- `isBot()`: Checks if the user-agent is a bot
5960
- `isChromeFamily()`: Checks if the browser is Chrome-based (uses Blink engine) — e.g., New Opera, New Edge, Vivaldi, Brave, Arc, etc.
6061
- `isElectron()`: Detects if current window is running within Electron
6162
- `isFromEU()`: Detects if current browser's timezone is from an EU country
@@ -64,6 +65,17 @@
6465

6566
---
6667

68+
## Version 2.0.0
69+
70+
- `ua-parser-js/extensions` submodule:
71+
- Add new CLI: ELinks, HTTPie
72+
- Add new crawler: AI2Bot, aiHitBot, anthropic-ai, Diffbot, ImagesiftBot, magpie-crawler, Omgilibot, Screaming Frog SEO Spider, Seznambot, Teoma, Timpibot, VelenPublicWebCrawler, Webzio-Extended, YouBot
73+
- Add new email: Airmail, BlueMail, eMClient, NaverMailApp, Sparrow, Yahoo
74+
- Add new fetcher: cohere-ai, Vercelbot
75+
- Add new library: java, python-urllib, python-requests
76+
- `ua-parser-js/helpers` submodule:
77+
- Add new method `isAIBot()`: Checks if the user-agent is an AI bot
78+
6779
## Version 2.0.0-rc.3
6880

6981
- Add support for Headers object

README.md

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
<p align="center">
2-
<a href="https://uaparser.dev"><img src="https://raw.githubusercontent.com/faisalman/ua-parser-js/gh-pages/images/uap-header.png"></a>
3-
</p>
1+
# UAParser.js PRO Business License
42

5-
# UAParser.js
3+
Thank you for choosing the UAParser.js PRO Business License.
64

7-
Thank you for purchasing UAParser.js PRO Business License, if you haven't please order here: https://store.faisalman.com
5+
Please be aware that using this package without a valid license purchase is strictly prohibited and constitutes a violation of applicable copyright laws.
6+
7+
An exception applies if the package is used solely as a part of a product developed by a valid license holder, in accordance with their license terms.
8+
9+
If you have not yet purchased a license, you may do so at https://store.faisalman.com.
810

911
# Download
1012

@@ -16,8 +18,12 @@ npm install @ua-parser-js/pro-business
1618

1719
https://docs.uaparser.dev
1820

21+
```js
22+
import { UAParser } from '@ua-parser-js/pro-business';
23+
```
24+
1925
# License
2026

2127
UAParser.js PRO Business
2228

23-
Copyright (c) 2012-2024 Faisal Salman <<[email protected]>>
29+
Copyright (c) 2023-2024 Faisal Salman <<[email protected]>>

dist/ua-parser.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ua-parser.pack.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "UAParser.js PRO Business",
33
"name": "@ua-parser-js/pro-business",
4-
"version": "2.0.0-rc.3",
4+
"version": "2.0.0",
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": [
@@ -180,7 +180,8 @@
180180
},
181181
"./enums": {
182182
"require": "./src/enums/ua-parser-enums.js",
183-
"import": "./src/enums/ua-parser-enums.mjs"
183+
"import": "./src/enums/ua-parser-enums.mjs",
184+
"types": "./src/enums/ua-parser-enums.d.ts"
184185
},
185186
"./extensions": {
186187
"require": "./src/extensions/ua-parser-extensions.js",

src/enums/ua-parser-enums.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////
2-
/* Enums for UAParser.js v2.0.0-rc.3
2+
/* Enums for UAParser.js v2.0.0
33
https://github.com/faisalman/ua-parser-js
44
Author: Faisal Salman <[email protected]>
55
UAParser.js PRO Business License */

src/enums/ua-parser-enums.mjs

+1-1
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.0-rc.3
6+
/* Enums for UAParser.js v2.0.0
77
https://github.com/faisalman/ua-parser-js
88
Author: Faisal Salman <[email protected]>
99
UAParser.js PRO Business License */

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.3
1+
// Type definitions for Helpers submodule of UAParser.js v2.0.0
22
// Project: https://github.com/faisalman/ua-parser-js
33
// Definitions by: Faisal Salman <https://github.com/faisalman>
44

src/extensions/ua-parser-extensions.js

+21-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///////////////////////////////////////////////
2-
/* Extensions for UAParser.js v2.0.0-rc.3
2+
/* Extensions for UAParser.js v2.0.0
33
https://github.com/faisalman/ua-parser-js
44
Author: Faisal Salman <[email protected]>
55
UAParser.js PRO Business License */
@@ -28,8 +28,8 @@ const LIBRARY = 'library';
2828

2929
const CLIs = Object.freeze({
3030
browser : [
31-
// wget / curl / lynx
32-
[/(wget|curl|lynx)[\/ ]([\w\.]+)/i], [NAME, VERSION, [TYPE, CLI]]
31+
// wget / curl / Lynx / ELinks / HTTPie
32+
[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i], [NAME, VERSION, [TYPE, CLI]]
3333
]
3434
});
3535

@@ -42,7 +42,6 @@ const Crawlers = Object.freeze({
4242
[
4343
// AhrefsBot - https://ahrefs.com/robot
4444
// Amazonbot - https://developer.amazon.com/amazonbot
45-
// Applebot - http://apple.com/go/applebot
4645
// Bingbot - http://www.bing.com/bingbot.htm
4746
// CCBot - https://commoncrawl.org/faq
4847
// Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot
@@ -54,13 +53,17 @@ const Crawlers = Object.freeze({
5453
// OpenAI's SearchGPT - https://platform.openai.com/docs/bots
5554
// PerplexityBot - https://perplexity.ai/perplexitybot
5655
// SemrushBot - http://www.semrush.com/bot.html
57-
/((?:ahrefs|amazon|apple|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush)bot)\/([\w\.]+)/i,
56+
// SeznamBot - http://napoveda.seznam.cz/seznambot-intro
57+
/((?:ahrefs|amazon|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush|seznam)bot)\/([\w\.-]+)/i,
58+
59+
// Applebot - http://apple.com/go/applebot
60+
/(applebot(?:-extended)?)\/([\w\.]+)/i,
5861

5962
// Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001
6063
/(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i,
6164

6265
// ClaudeBot (Anthropic)
63-
/(claude(?:bot|-web))\/([\w\.]+)/i,
66+
/(claude(?:bot|-web)|anthropic-ai)\/?([\w\.]*)/i,
6467

6568
// Coc Coc Bot - https://help.coccoc.com/en/search-engine
6669
/(coccocbot-(?:image|web))\/([\w\.]+)/i,
@@ -87,8 +90,8 @@ const Crawlers = Object.freeze({
8790
// Yeti (Naver)
8891
/(yeti)\/([\w\.]+)/i,
8992

90-
// YisouSpider
91-
/(yisouspider)\/?([\w\.]*)/i
93+
// aiHitBot / Diffbot / Magpie-Crawler / Omgilibot / Webzio-Extended / Screaming Frog SEO Spider / Timpibot / VelenPublicWebCrawler / YisouSpider / YouBot
94+
/((?:aihit|diff|timpi|you)bot|omgili(?:bot)?|(?:magpie-|velenpublicweb)crawler|webzio-extended|(?:screaming frog seo |yisou)spider)\/?([\w\.]*)/i
9295
],
9396

9497
[NAME, VERSION, [TYPE, CRAWLER]],
@@ -97,13 +100,15 @@ const Crawlers = Object.freeze({
97100
// Google Bots
98101
/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,
99102

103+
// AI2Bot - https://allenai.org/crawler
100104
// Bytespider
101105
// DataForSeoBot - https://dataforseo.com/dataforseo-bot
102106
// Huawei AspiegelBot / PetalBot https://aspiegel.com/petalbot
107+
// ImagesiftBot - https://imagesift.com/about
103108
// Qihoo 360Spider
104109
// TurnitinBot - https://www.turnitin.com/robot/crawlerinfo.html
105110
// Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
106-
/(360spider-?(?:image|video)?|bytespider|(?:aspiegel|dataforseo|petal|turnitin)bot|(?=yahoo! )slurp)/i
111+
/\b(360spider-?(?:image|video)?|bytespider|(?:ai2|aspiegel|dataforseo|imagesift|petal|turnitin)bot|teoma|(?=yahoo! )slurp)/i
107112
],
108113
[NAME, [TYPE, CRAWLER]]
109114
]
@@ -195,8 +200,10 @@ const ExtraDevices = Object.freeze({
195200

196201
const Emails = Object.freeze({
197202
browser : [
203+
[
198204
// Evolution / Kontact/KMail / [Microsoft/Mac] Outlook / Thunderbird
199-
[/(evolution|kmail2?|kontact|(?:microsoft |mac)outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
205+
/(airmail|bluemail|emclient|evolution|foxmail|kmail2?|kontact|(?:microsoft |mac)?outlook(?:-express)?|navermailapp|(?!chrom.+)sparrow|thunderbird|yahoo)(?:m.+ail; |[\/ ])([\w\.]+)/i
206+
], [NAME, VERSION, [TYPE, EMAIL]]
200207
]
201208
});
202209

@@ -234,8 +241,8 @@ const Fetchers = Object.freeze({
234241
],
235242
[NAME, VERSION, [TYPE, FETCHER]],
236243

237-
// Google Bots / Snapchat
238-
[/(feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i],
244+
// Google Bots / Cohere / Snapchat / Vercelbot
245+
[/(cohere-ai|vercelbot|feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i],
239246
[NAME, [TYPE, FETCHER]],
240247
]
241248
});
@@ -293,8 +300,6 @@ const MediaPlayers = Object.freeze({
293300
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
294301

295302
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
296-
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
297-
// Java/urllib/requests/wget/cURL
298303
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
299304
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
300305

@@ -370,8 +375,8 @@ const MediaPlayers = Object.freeze({
370375

371376
const Libraries = Object.freeze({
372377
browser : [
373-
// Axios/jsdom/Scrapy
374-
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
378+
// Axios/jsdom/Scrapy/Java/urllib/requests
379+
[/\b(axios|jsdom|scrapy|java|python-urllib|python-requests)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
375380
]
376381
});
377382

src/extensions/ua-parser-extensions.mjs

+21-16
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// Source: /src/extensions/ua-parser-extensions.js
44

55
///////////////////////////////////////////////
6-
/* Extensions for UAParser.js v2.0.0-rc.3
6+
/* Extensions for UAParser.js v2.0.0
77
https://github.com/faisalman/ua-parser-js
88
Author: Faisal Salman <[email protected]>
99
UAParser.js PRO Business License */
@@ -32,8 +32,8 @@ const LIBRARY = 'library';
3232

3333
const CLIs = Object.freeze({
3434
browser : [
35-
// wget / curl / lynx
36-
[/(wget|curl|lynx)[\/ ]([\w\.]+)/i], [NAME, VERSION, [TYPE, CLI]]
35+
// wget / curl / Lynx / ELinks / HTTPie
36+
[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i], [NAME, VERSION, [TYPE, CLI]]
3737
]
3838
});
3939

@@ -46,7 +46,6 @@ const Crawlers = Object.freeze({
4646
[
4747
// AhrefsBot - https://ahrefs.com/robot
4848
// Amazonbot - https://developer.amazon.com/amazonbot
49-
// Applebot - http://apple.com/go/applebot
5049
// Bingbot - http://www.bing.com/bingbot.htm
5150
// CCBot - https://commoncrawl.org/faq
5251
// Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot
@@ -58,13 +57,17 @@ const Crawlers = Object.freeze({
5857
// OpenAI's SearchGPT - https://platform.openai.com/docs/bots
5958
// PerplexityBot - https://perplexity.ai/perplexitybot
6059
// SemrushBot - http://www.semrush.com/bot.html
61-
/((?:ahrefs|amazon|apple|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush)bot)\/([\w\.]+)/i,
60+
// SeznamBot - http://napoveda.seznam.cz/seznambot-intro
61+
/((?:ahrefs|amazon|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush|seznam)bot)\/([\w\.-]+)/i,
62+
63+
// Applebot - http://apple.com/go/applebot
64+
/(applebot(?:-extended)?)\/([\w\.]+)/i,
6265

6366
// Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001
6467
/(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i,
6568

6669
// ClaudeBot (Anthropic)
67-
/(claude(?:bot|-web))\/([\w\.]+)/i,
70+
/(claude(?:bot|-web)|anthropic-ai)\/?([\w\.]*)/i,
6871

6972
// Coc Coc Bot - https://help.coccoc.com/en/search-engine
7073
/(coccocbot-(?:image|web))\/([\w\.]+)/i,
@@ -91,8 +94,8 @@ const Crawlers = Object.freeze({
9194
// Yeti (Naver)
9295
/(yeti)\/([\w\.]+)/i,
9396

94-
// YisouSpider
95-
/(yisouspider)\/?([\w\.]*)/i
97+
// aiHitBot / Diffbot / Magpie-Crawler / Omgilibot / Webzio-Extended / Screaming Frog SEO Spider / Timpibot / VelenPublicWebCrawler / YisouSpider / YouBot
98+
/((?:aihit|diff|timpi|you)bot|omgili(?:bot)?|(?:magpie-|velenpublicweb)crawler|webzio-extended|(?:screaming frog seo |yisou)spider)\/?([\w\.]*)/i
9699
],
97100

98101
[NAME, VERSION, [TYPE, CRAWLER]],
@@ -101,13 +104,15 @@ const Crawlers = Object.freeze({
101104
// Google Bots
102105
/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,
103106

107+
// AI2Bot - https://allenai.org/crawler
104108
// Bytespider
105109
// DataForSeoBot - https://dataforseo.com/dataforseo-bot
106110
// Huawei AspiegelBot / PetalBot https://aspiegel.com/petalbot
111+
// ImagesiftBot - https://imagesift.com/about
107112
// Qihoo 360Spider
108113
// TurnitinBot - https://www.turnitin.com/robot/crawlerinfo.html
109114
// Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
110-
/(360spider-?(?:image|video)?|bytespider|(?:aspiegel|dataforseo|petal|turnitin)bot|(?=yahoo! )slurp)/i
115+
/\b(360spider-?(?:image|video)?|bytespider|(?:ai2|aspiegel|dataforseo|imagesift|petal|turnitin)bot|teoma|(?=yahoo! )slurp)/i
111116
],
112117
[NAME, [TYPE, CRAWLER]]
113118
]
@@ -199,8 +204,10 @@ const ExtraDevices = Object.freeze({
199204

200205
const Emails = Object.freeze({
201206
browser : [
207+
[
202208
// Evolution / Kontact/KMail / [Microsoft/Mac] Outlook / Thunderbird
203-
[/(evolution|kmail2?|kontact|(?:microsoft |mac)outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
209+
/(airmail|bluemail|emclient|evolution|foxmail|kmail2?|kontact|(?:microsoft |mac)?outlook(?:-express)?|navermailapp|(?!chrom.+)sparrow|thunderbird|yahoo)(?:m.+ail; |[\/ ])([\w\.]+)/i
210+
], [NAME, VERSION, [TYPE, EMAIL]]
204211
]
205212
});
206213

@@ -238,8 +245,8 @@ const Fetchers = Object.freeze({
238245
],
239246
[NAME, VERSION, [TYPE, FETCHER]],
240247

241-
// Google Bots / Snapchat
242-
[/(feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i],
248+
// Google Bots / Cohere / Snapchat / Vercelbot
249+
[/(cohere-ai|vercelbot|feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i],
243250
[NAME, [TYPE, FETCHER]],
244251
]
245252
});
@@ -297,8 +304,6 @@ const MediaPlayers = Object.freeze({
297304
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
298305

299306
/(htc streaming player)\s[\w_]+\s\/\s([\d\.]+)/i, // HTC Streaming Player
300-
/(java|python-urllib|python-requests|wget|libcurl)\/([\w\.-_]+)/i,
301-
// Java/urllib/requests/wget/cURL
302307
/(lavf)([\d\.]+)/i // Lavf (FFMPEG)
303308
], [NAME, VERSION, [TYPE, MEDIAPLAYER]], [
304309

@@ -374,8 +379,8 @@ const MediaPlayers = Object.freeze({
374379

375380
const Libraries = Object.freeze({
376381
browser : [
377-
// Axios/jsdom/Scrapy
378-
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
382+
// Axios/jsdom/Scrapy/Java/urllib/requests
383+
[/\b(axios|jsdom|scrapy|java|python-urllib|python-requests)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
379384
]
380385
});
381386

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

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.3
1+
// Type definitions for Helpers submodule of UAParser.js v2.0.0
22
// Project: https://github.com/faisalman/ua-parser-js
33
// Definitions by: Faisal Salman <https://github.com/faisalman>
44

55
import { IResult } from "../main/ua-parser";
66

77
declare function getDeviceVendor(model: string): string | undefined;
8-
declare function isAppleSilicon(res: IResult, useFeatureDetection?: boolean): boolean;
9-
declare function isBot(res: IResult): boolean;
10-
declare function isChromeFamily(res: IResult): boolean;
8+
declare function isAppleSilicon(resultOrUA: IResult | string): boolean;
9+
declare function isAIBot(resultOrUA: IResult | string): boolean;
10+
declare function isBot(resultOrUA: IResult | string): boolean;
11+
declare function isChromeFamily(resultOrUA: IResult | string): boolean;
1112
declare function isElectron(): boolean;
1213
declare function isFromEU(): boolean;
1314
declare function isFrozenUA(ua: string): boolean;
@@ -16,6 +17,7 @@ declare function isStandalonePWA(): boolean;
1617
export {
1718
getDeviceVendor,
1819
isAppleSilicon,
20+
isAIBot,
1921
isBot,
2022
isChromeFamily,
2123
isElectron,

0 commit comments

Comments
 (0)