ua-parser-js 2.0.0-rc.2 → 2.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -27
- package/dist/ua-parser.min.js +2 -2
- package/dist/ua-parser.pack.js +2 -2
- package/package.json +4 -4
- package/src/enums/ua-parser-enums.js +10 -2
- package/src/enums/ua-parser-enums.mjs +10 -2
- package/src/extensions/ua-parser-extensions.d.ts +3 -3
- package/src/extensions/ua-parser-extensions.js +56 -24
- package/src/extensions/ua-parser-extensions.mjs +56 -24
- package/src/helpers/ua-parser-helpers.d.ts +2 -2
- package/src/helpers/ua-parser-helpers.js +14 -12
- package/src/helpers/ua-parser-helpers.mjs +14 -12
- package/src/main/ua-parser.d.ts +4 -4
- package/src/main/ua-parser.js +36 -8
- package/src/main/ua-parser.mjs +36 -8
@@ -3,7 +3,7 @@
|
|
3
3
|
// Source: /src/enums/ua-parser-enums.js
|
4
4
|
|
5
5
|
///////////////////////////////////////////////
|
6
|
-
/* Enums for UAParser.js v2.0.0-rc.
|
6
|
+
/* Enums for UAParser.js v2.0.0-rc.3
|
7
7
|
https://github.com/faisalman/ua-parser-js
|
8
8
|
Author: Faisal Salman <f@faisalman.com>
|
9
9
|
AGPLv3 License */
|
@@ -59,6 +59,7 @@ const Browser = Object.freeze({
|
|
59
59
|
GOOGLE_SEARCH: 'GSA',
|
60
60
|
HELIO: 'Helio',
|
61
61
|
HEYTAP: 'HeyTap',
|
62
|
+
HONOR: 'Honor',
|
62
63
|
HUAWEI: 'Huawei Browser',
|
63
64
|
ICAB: 'iCab',
|
64
65
|
ICE: 'ICE Browser',
|
@@ -162,7 +163,7 @@ const BrowserType = Object.freeze({
|
|
162
163
|
FETCHER: 'fetcher',
|
163
164
|
INAPP: 'inapp',
|
164
165
|
MEDIAPLAYER: 'mediaplayer',
|
165
|
-
|
166
|
+
LIBRARY: 'library'
|
166
167
|
});
|
167
168
|
|
168
169
|
const CPU = Object.freeze({
|
@@ -198,6 +199,7 @@ const Device = Object.freeze({
|
|
198
199
|
|
199
200
|
const Vendor = Object.freeze({
|
200
201
|
ACER: 'Acer',
|
202
|
+
ADVAN: 'Advan',
|
201
203
|
ALCATEL: 'Alcatel',
|
202
204
|
APPLE: 'Apple',
|
203
205
|
AMAZON: 'Amazon',
|
@@ -206,7 +208,9 @@ const Vendor = Object.freeze({
|
|
206
208
|
ATT: 'AT&T',
|
207
209
|
BENQ: 'BenQ',
|
208
210
|
BLACKBERRY: 'BlackBerry',
|
211
|
+
CAT: 'Cat',
|
209
212
|
DELL: 'Dell',
|
213
|
+
ENERGIZER: 'Energizer',
|
210
214
|
ESSENTIAL: 'Essential',
|
211
215
|
FACEBOOK: 'Facebook',
|
212
216
|
FAIRPHONE: 'Fairphone',
|
@@ -216,6 +220,7 @@ const Vendor = Object.freeze({
|
|
216
220
|
HP: 'HP',
|
217
221
|
HTC: 'HTC',
|
218
222
|
HUAWEI: 'Huawei',
|
223
|
+
IMO: 'IMO',
|
219
224
|
INFINIX: 'Infinix',
|
220
225
|
ITEL: 'itel',
|
221
226
|
JOLLA: 'Jolla',
|
@@ -223,6 +228,7 @@ const Vendor = Object.freeze({
|
|
223
228
|
LENOVO: 'Lenovo',
|
224
229
|
LG: 'LG',
|
225
230
|
MEIZU: 'Meizu',
|
231
|
+
MICROMAX: 'Micromax',
|
226
232
|
MICROSOFT: 'Microsoft',
|
227
233
|
MOTOROLA: 'Motorola',
|
228
234
|
NEXIAN: 'Nexian',
|
@@ -244,6 +250,7 @@ const Vendor = Object.freeze({
|
|
244
250
|
SAMSUNG: 'Samsung',
|
245
251
|
SHARP: 'Sharp',
|
246
252
|
SIEMENS: 'Siemens',
|
253
|
+
SMARTFREN: 'Smartfren',
|
247
254
|
SONY: 'Sony',
|
248
255
|
SPRINT: 'Sprint',
|
249
256
|
TCL: 'TCL',
|
@@ -277,6 +284,7 @@ const Engine = Object.freeze({
|
|
277
284
|
NETFRONT: 'NetFront',
|
278
285
|
NETSURF: 'NetSurf',
|
279
286
|
PRESTO: 'Presto',
|
287
|
+
SERVO: 'Servo',
|
280
288
|
TASMAN: 'Tasman',
|
281
289
|
TRIDENT: 'Trident',
|
282
290
|
W3M: 'w3m',
|
@@ -1,4 +1,4 @@
|
|
1
|
-
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.
|
1
|
+
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.3
|
2
2
|
// Project: https://github.com/faisalman/ua-parser-js
|
3
3
|
// Definitions by: Faisal Salman <https://github.com/faisalman>
|
4
4
|
|
@@ -11,5 +11,5 @@ export const ExtraDevices: UAParserExt;
|
|
11
11
|
export const Emails: UAParserExt;
|
12
12
|
export const Fetchers: UAParserExt;
|
13
13
|
export const InApps: UAParserExt;
|
14
|
-
export const
|
15
|
-
export const
|
14
|
+
export const Libraries: UAParserExt;
|
15
|
+
export const MediaPlayers: UAParserExt;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
///////////////////////////////////////////////
|
2
|
-
/* Extensions for UAParser.js v2.0.0-rc.
|
2
|
+
/* Extensions for UAParser.js v2.0.0-rc.3
|
3
3
|
https://github.com/faisalman/ua-parser-js
|
4
4
|
Author: Faisal Salman <f@faisalman.com>
|
5
5
|
AGPLv3 License */
|
@@ -20,7 +20,7 @@ const EMAIL = 'email';
|
|
20
20
|
const FETCHER = 'fetcher';
|
21
21
|
const INAPP = 'inapp';
|
22
22
|
const MEDIAPLAYER = 'mediaplayer';
|
23
|
-
const
|
23
|
+
const LIBRARY = 'library';
|
24
24
|
|
25
25
|
//////////////////////
|
26
26
|
// COMMAND LINE APPS
|
@@ -44,26 +44,36 @@ const Crawlers = Object.freeze({
|
|
44
44
|
// Amazonbot - https://developer.amazon.com/amazonbot
|
45
45
|
// Applebot - http://apple.com/go/applebot
|
46
46
|
// Bingbot - http://www.bing.com/bingbot.htm
|
47
|
+
// CCBot - https://commoncrawl.org/faq
|
47
48
|
// Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot
|
48
49
|
// DuckDuckBot - http://duckduckgo.com/duckduckbot.html
|
49
50
|
// FacebookBot - https://developers.facebook.com/docs/sharing/bot/
|
50
51
|
// GPTBot - https://platform.openai.com/docs/gptbot
|
51
52
|
// MJ12bot - https://mj12bot.com/
|
52
|
-
//
|
53
|
+
// MojeekBot - https://www.mojeek.com/bot.html
|
54
|
+
// OpenAI's SearchGPT - https://platform.openai.com/docs/bots
|
55
|
+
// PerplexityBot - https://perplexity.ai/perplexitybot
|
53
56
|
// SemrushBot - http://www.semrush.com/bot.html
|
54
|
-
/((?:ahrefs|amazon|apple|bing|dot|duckduck|facebook|gpt|mj12|oai-search|semrush)bot)\/([\w\.]+)/i,
|
57
|
+
/((?:ahrefs|amazon|apple|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush)bot)\/([\w\.]+)/i,
|
55
58
|
|
56
59
|
// Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001
|
57
60
|
/(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i,
|
58
61
|
|
59
|
-
// ClaudeBot
|
62
|
+
// ClaudeBot (Anthropic)
|
60
63
|
/(claude(?:bot|-web))\/([\w\.]+)/i,
|
61
64
|
|
62
65
|
// Coc Coc Bot - https://help.coccoc.com/en/search-engine
|
63
66
|
/(coccocbot-(?:image|web))\/([\w\.]+)/i,
|
64
67
|
|
68
|
+
// Facebook / Meta
|
69
|
+
// https://developers.facebook.com/docs/sharing/webmasters/web-crawlers
|
70
|
+
/(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,
|
71
|
+
|
65
72
|
// Googlebot - http://www.google.com/bot.html
|
66
|
-
/(google(?:bot|other)(?:-image|-video|-news
|
73
|
+
/(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i,
|
74
|
+
|
75
|
+
// Internet Archive (archive.org)
|
76
|
+
/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,
|
67
77
|
|
68
78
|
// Sogou Spider
|
69
79
|
/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,
|
@@ -72,14 +82,29 @@ const Crawlers = Object.freeze({
|
|
72
82
|
/(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i,
|
73
83
|
|
74
84
|
// Yandex Bots - https://yandex.com/bots
|
75
|
-
/(yandex(?:(?:mobile)?(?:accessibility|additional|renderresources|screenshot|sprav)?bot|image(?:s|resizer)|video(?:parser)?|blogs|adnet|favicons|fordomain|market|media|metrika|news|ontodb(?:api)?|pagechecker|partner|rca|tracker|turbo|vertis|webmaster|antivirus))\/([\w\.]+)/i
|
85
|
+
/(yandex(?:(?:mobile)?(?:accessibility|additional|renderresources|screenshot|sprav)?bot|image(?:s|resizer)|video(?:parser)?|blogs|adnet|favicons|fordomain|market|media|metrika|news|ontodb(?:api)?|pagechecker|partner|rca|tracker|turbo|vertis|webmaster|antivirus))\/([\w\.]+)/i,
|
86
|
+
|
87
|
+
// Yeti (Naver)
|
88
|
+
/(yeti)\/([\w\.]+)/i,
|
89
|
+
|
90
|
+
// YisouSpider
|
91
|
+
/(yisouspider)\/?([\w\.]*)/i
|
76
92
|
],
|
77
93
|
|
78
94
|
[NAME, VERSION, [TYPE, CRAWLER]],
|
79
95
|
|
80
|
-
|
81
|
-
|
82
|
-
|
96
|
+
[
|
97
|
+
// Google Bots
|
98
|
+
/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,
|
99
|
+
|
100
|
+
// Bytespider
|
101
|
+
// DataForSeoBot - https://dataforseo.com/dataforseo-bot
|
102
|
+
// Huawei AspiegelBot / PetalBot https://aspiegel.com/petalbot
|
103
|
+
// Qihoo 360Spider
|
104
|
+
// TurnitinBot - https://www.turnitin.com/robot/crawlerinfo.html
|
105
|
+
// Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
|
106
|
+
/(360spider-?(?:image|video)?|bytespider|(?:aspiegel|dataforseo|petal|turnitin)bot|(?=yahoo! )slurp)/i
|
107
|
+
],
|
83
108
|
[NAME, [TYPE, CRAWLER]]
|
84
109
|
]
|
85
110
|
});
|
@@ -170,8 +195,8 @@ const ExtraDevices = Object.freeze({
|
|
170
195
|
|
171
196
|
const Emails = Object.freeze({
|
172
197
|
browser : [
|
173
|
-
// Microsoft Outlook / Thunderbird
|
174
|
-
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
|
198
|
+
// Evolution / Kontact/KMail / [Microsoft/Mac] Outlook / Thunderbird
|
199
|
+
[/(evolution|kmail2?|kontact|(?:microsoft |mac)outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
|
175
200
|
]
|
176
201
|
});
|
177
202
|
|
@@ -184,8 +209,15 @@ const Fetchers = Object.freeze({
|
|
184
209
|
[
|
185
210
|
// AhrefsSiteAudit - https://ahrefs.com/robot/site-audit
|
186
211
|
// ChatGPT-User - https://platform.openai.com/docs/plugins/bot
|
212
|
+
// DuckAssistBot - https://duckduckgo.com/duckassistbot/
|
187
213
|
// BingPreview / Mastodon / Pinterestbot / Redditbot / Rogerbot / Telegrambot / Twitterbot / UptimeRobot
|
188
|
-
/(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot)\/([\w\.]+)/i,
|
214
|
+
/(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot)\/([\w\.]+)/i,
|
215
|
+
|
216
|
+
// Google Site Verifier
|
217
|
+
/(google-site-verification)\/([\w\.]+)/i,
|
218
|
+
|
219
|
+
// Meta
|
220
|
+
/(meta-externalfetcher)\/([\w\.]+)/i,
|
189
221
|
|
190
222
|
// Slackbot - https://api.slack.com/robots
|
191
223
|
/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i,
|
@@ -203,7 +235,7 @@ const Fetchers = Object.freeze({
|
|
203
235
|
[NAME, VERSION, [TYPE, FETCHER]],
|
204
236
|
|
205
237
|
// Google Bots / Snapchat
|
206
|
-
[/(feedfetcher-google|google
|
238
|
+
[/(feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i],
|
207
239
|
[NAME, [TYPE, FETCHER]],
|
208
240
|
]
|
209
241
|
});
|
@@ -252,8 +284,8 @@ const MediaPlayers = Object.freeze({
|
|
252
284
|
/(flrp)\/([\w\.-]+)/i // Flip Player
|
253
285
|
], [[NAME, 'Flip Player'], VERSION, [TYPE, MEDIAPLAYER]], [
|
254
286
|
|
255
|
-
/(fstream|nativehost|queryseekspider
|
256
|
-
// FStream/NativeHost/QuerySeekSpider
|
287
|
+
/(fstream|nativehost|queryseekspider)/i
|
288
|
+
// FStream/NativeHost/QuerySeekSpider
|
257
289
|
], [NAME, [TYPE, MEDIAPLAYER]], [
|
258
290
|
|
259
291
|
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
|
@@ -332,14 +364,14 @@ const MediaPlayers = Object.freeze({
|
|
332
364
|
]
|
333
365
|
});
|
334
366
|
|
335
|
-
|
336
|
-
//
|
337
|
-
|
367
|
+
/////////////
|
368
|
+
// LIBRARIES
|
369
|
+
//////////////
|
338
370
|
|
339
|
-
const
|
371
|
+
const Libraries = Object.freeze({
|
340
372
|
browser : [
|
341
373
|
// Axios/jsdom/Scrapy
|
342
|
-
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE,
|
374
|
+
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
|
343
375
|
]
|
344
376
|
});
|
345
377
|
|
@@ -352,7 +384,7 @@ const Bots = Object.freeze({
|
|
352
384
|
...CLIs.browser,
|
353
385
|
...Crawlers.browser,
|
354
386
|
...Fetchers.browser,
|
355
|
-
...
|
387
|
+
...Libraries.browser
|
356
388
|
]
|
357
389
|
});
|
358
390
|
|
@@ -364,6 +396,6 @@ module.exports = {
|
|
364
396
|
Emails,
|
365
397
|
Fetchers,
|
366
398
|
InApps,
|
367
|
-
|
368
|
-
|
399
|
+
Libraries,
|
400
|
+
MediaPlayers
|
369
401
|
};
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// Source: /src/extensions/ua-parser-extensions.js
|
4
4
|
|
5
5
|
///////////////////////////////////////////////
|
6
|
-
/* Extensions for UAParser.js v2.0.0-rc.
|
6
|
+
/* Extensions for UAParser.js v2.0.0-rc.3
|
7
7
|
https://github.com/faisalman/ua-parser-js
|
8
8
|
Author: Faisal Salman <f@faisalman.com>
|
9
9
|
AGPLv3 License */
|
@@ -24,7 +24,7 @@ const EMAIL = 'email';
|
|
24
24
|
const FETCHER = 'fetcher';
|
25
25
|
const INAPP = 'inapp';
|
26
26
|
const MEDIAPLAYER = 'mediaplayer';
|
27
|
-
const
|
27
|
+
const LIBRARY = 'library';
|
28
28
|
|
29
29
|
//////////////////////
|
30
30
|
// COMMAND LINE APPS
|
@@ -48,26 +48,36 @@ const Crawlers = Object.freeze({
|
|
48
48
|
// Amazonbot - https://developer.amazon.com/amazonbot
|
49
49
|
// Applebot - http://apple.com/go/applebot
|
50
50
|
// Bingbot - http://www.bing.com/bingbot.htm
|
51
|
+
// CCBot - https://commoncrawl.org/faq
|
51
52
|
// Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot
|
52
53
|
// DuckDuckBot - http://duckduckgo.com/duckduckbot.html
|
53
54
|
// FacebookBot - https://developers.facebook.com/docs/sharing/bot/
|
54
55
|
// GPTBot - https://platform.openai.com/docs/gptbot
|
55
56
|
// MJ12bot - https://mj12bot.com/
|
56
|
-
//
|
57
|
+
// MojeekBot - https://www.mojeek.com/bot.html
|
58
|
+
// OpenAI's SearchGPT - https://platform.openai.com/docs/bots
|
59
|
+
// PerplexityBot - https://perplexity.ai/perplexitybot
|
57
60
|
// SemrushBot - http://www.semrush.com/bot.html
|
58
|
-
/((?:ahrefs|amazon|apple|bing|dot|duckduck|facebook|gpt|mj12|oai-search|semrush)bot)\/([\w\.]+)/i,
|
61
|
+
/((?:ahrefs|amazon|apple|bing|cc|dot|duckduck|exa|facebook|gpt|mj12|mojeek|oai-search|perplexity|semrush)bot)\/([\w\.]+)/i,
|
59
62
|
|
60
63
|
// Baiduspider https://help.baidu.com/question?prod_id=99&class=0&id=3001
|
61
64
|
/(baiduspider)[-imagevdonsfcpr]{0,6}\/([\w\.]+)/i,
|
62
65
|
|
63
|
-
// ClaudeBot
|
66
|
+
// ClaudeBot (Anthropic)
|
64
67
|
/(claude(?:bot|-web))\/([\w\.]+)/i,
|
65
68
|
|
66
69
|
// Coc Coc Bot - https://help.coccoc.com/en/search-engine
|
67
70
|
/(coccocbot-(?:image|web))\/([\w\.]+)/i,
|
68
71
|
|
72
|
+
// Facebook / Meta
|
73
|
+
// https://developers.facebook.com/docs/sharing/webmasters/web-crawlers
|
74
|
+
/(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,
|
75
|
+
|
69
76
|
// Googlebot - http://www.google.com/bot.html
|
70
|
-
/(google(?:bot|other)(?:-image|-video|-news
|
77
|
+
/(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i,
|
78
|
+
|
79
|
+
// Internet Archive (archive.org)
|
80
|
+
/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,
|
71
81
|
|
72
82
|
// Sogou Spider
|
73
83
|
/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,
|
@@ -76,14 +86,29 @@ const Crawlers = Object.freeze({
|
|
76
86
|
/(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i,
|
77
87
|
|
78
88
|
// Yandex Bots - https://yandex.com/bots
|
79
|
-
/(yandex(?:(?:mobile)?(?:accessibility|additional|renderresources|screenshot|sprav)?bot|image(?:s|resizer)|video(?:parser)?|blogs|adnet|favicons|fordomain|market|media|metrika|news|ontodb(?:api)?|pagechecker|partner|rca|tracker|turbo|vertis|webmaster|antivirus))\/([\w\.]+)/i
|
89
|
+
/(yandex(?:(?:mobile)?(?:accessibility|additional|renderresources|screenshot|sprav)?bot|image(?:s|resizer)|video(?:parser)?|blogs|adnet|favicons|fordomain|market|media|metrika|news|ontodb(?:api)?|pagechecker|partner|rca|tracker|turbo|vertis|webmaster|antivirus))\/([\w\.]+)/i,
|
90
|
+
|
91
|
+
// Yeti (Naver)
|
92
|
+
/(yeti)\/([\w\.]+)/i,
|
93
|
+
|
94
|
+
// YisouSpider
|
95
|
+
/(yisouspider)\/?([\w\.]*)/i
|
80
96
|
],
|
81
97
|
|
82
98
|
[NAME, VERSION, [TYPE, CRAWLER]],
|
83
99
|
|
84
|
-
|
85
|
-
|
86
|
-
|
100
|
+
[
|
101
|
+
// Google Bots
|
102
|
+
/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,
|
103
|
+
|
104
|
+
// Bytespider
|
105
|
+
// DataForSeoBot - https://dataforseo.com/dataforseo-bot
|
106
|
+
// Huawei AspiegelBot / PetalBot https://aspiegel.com/petalbot
|
107
|
+
// Qihoo 360Spider
|
108
|
+
// TurnitinBot - https://www.turnitin.com/robot/crawlerinfo.html
|
109
|
+
// Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
|
110
|
+
/(360spider-?(?:image|video)?|bytespider|(?:aspiegel|dataforseo|petal|turnitin)bot|(?=yahoo! )slurp)/i
|
111
|
+
],
|
87
112
|
[NAME, [TYPE, CRAWLER]]
|
88
113
|
]
|
89
114
|
});
|
@@ -174,8 +199,8 @@ const ExtraDevices = Object.freeze({
|
|
174
199
|
|
175
200
|
const Emails = Object.freeze({
|
176
201
|
browser : [
|
177
|
-
// Microsoft Outlook / Thunderbird
|
178
|
-
[/(microsoft outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
|
202
|
+
// Evolution / Kontact/KMail / [Microsoft/Mac] Outlook / Thunderbird
|
203
|
+
[/(evolution|kmail2?|kontact|(?:microsoft |mac)outlook|thunderbird)[\s\/]([\w\.]+)/i], [NAME, VERSION, [TYPE, EMAIL]]
|
179
204
|
]
|
180
205
|
});
|
181
206
|
|
@@ -188,8 +213,15 @@ const Fetchers = Object.freeze({
|
|
188
213
|
[
|
189
214
|
// AhrefsSiteAudit - https://ahrefs.com/robot/site-audit
|
190
215
|
// ChatGPT-User - https://platform.openai.com/docs/plugins/bot
|
216
|
+
// DuckAssistBot - https://duckduckgo.com/duckassistbot/
|
191
217
|
// BingPreview / Mastodon / Pinterestbot / Redditbot / Rogerbot / Telegrambot / Twitterbot / UptimeRobot
|
192
|
-
/(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot)\/([\w\.]+)/i,
|
218
|
+
/(ahrefssiteaudit|bingpreview|chatgpt-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|telegram|twitter|uptimero)bot)\/([\w\.]+)/i,
|
219
|
+
|
220
|
+
// Google Site Verifier
|
221
|
+
/(google-site-verification)\/([\w\.]+)/i,
|
222
|
+
|
223
|
+
// Meta
|
224
|
+
/(meta-externalfetcher)\/([\w\.]+)/i,
|
193
225
|
|
194
226
|
// Slackbot - https://api.slack.com/robots
|
195
227
|
/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i,
|
@@ -207,7 +239,7 @@ const Fetchers = Object.freeze({
|
|
207
239
|
[NAME, VERSION, [TYPE, FETCHER]],
|
208
240
|
|
209
241
|
// Google Bots / Snapchat
|
210
|
-
[/(feedfetcher-google|google
|
242
|
+
[/(feedfetcher-google|google(?:-read-aloud|producer)|(?=bot; )snapchat)/i],
|
211
243
|
[NAME, [TYPE, FETCHER]],
|
212
244
|
]
|
213
245
|
});
|
@@ -256,8 +288,8 @@ const MediaPlayers = Object.freeze({
|
|
256
288
|
/(flrp)\/([\w\.-]+)/i // Flip Player
|
257
289
|
], [[NAME, 'Flip Player'], VERSION, [TYPE, MEDIAPLAYER]], [
|
258
290
|
|
259
|
-
/(fstream|nativehost|queryseekspider
|
260
|
-
// FStream/NativeHost/QuerySeekSpider
|
291
|
+
/(fstream|nativehost|queryseekspider)/i
|
292
|
+
// FStream/NativeHost/QuerySeekSpider
|
261
293
|
], [NAME, [TYPE, MEDIAPLAYER]], [
|
262
294
|
|
263
295
|
/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i
|
@@ -336,14 +368,14 @@ const MediaPlayers = Object.freeze({
|
|
336
368
|
]
|
337
369
|
});
|
338
370
|
|
339
|
-
|
340
|
-
//
|
341
|
-
|
371
|
+
/////////////
|
372
|
+
// LIBRARIES
|
373
|
+
//////////////
|
342
374
|
|
343
|
-
const
|
375
|
+
const Libraries = Object.freeze({
|
344
376
|
browser : [
|
345
377
|
// Axios/jsdom/Scrapy
|
346
|
-
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE,
|
378
|
+
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
|
347
379
|
]
|
348
380
|
});
|
349
381
|
|
@@ -356,7 +388,7 @@ const Bots = Object.freeze({
|
|
356
388
|
...CLIs.browser,
|
357
389
|
...Crawlers.browser,
|
358
390
|
...Fetchers.browser,
|
359
|
-
...
|
391
|
+
...Libraries.browser
|
360
392
|
]
|
361
393
|
});
|
362
394
|
|
@@ -368,6 +400,6 @@ export {
|
|
368
400
|
Emails,
|
369
401
|
Fetchers,
|
370
402
|
InApps,
|
371
|
-
|
372
|
-
|
403
|
+
Libraries,
|
404
|
+
MediaPlayers
|
373
405
|
};
|
@@ -1,11 +1,11 @@
|
|
1
|
-
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.
|
1
|
+
// Type definitions for Helpers submodule of UAParser.js v2.0.0-rc.3
|
2
2
|
// Project: https://github.com/faisalman/ua-parser-js
|
3
3
|
// Definitions by: Faisal Salman <https://github.com/faisalman>
|
4
4
|
|
5
5
|
import { IResult } from "../main/ua-parser";
|
6
6
|
|
7
7
|
declare function getDeviceVendor(model: string): string | undefined;
|
8
|
-
declare function isAppleSilicon(res: IResult): boolean;
|
8
|
+
declare function isAppleSilicon(res: IResult, useFeatureDetection?: boolean): boolean;
|
9
9
|
declare function isBot(res: IResult): boolean;
|
10
10
|
declare function isChromeFamily(res: IResult): boolean;
|
11
11
|
declare function isElectron(): boolean;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
///////////////////////////////////////////////
|
2
|
-
/* Helpers for UAParser.js v2.0.0-rc.
|
2
|
+
/* Helpers for UAParser.js v2.0.0-rc.3
|
3
3
|
https://github.com/faisalman/ua-parser-js
|
4
4
|
Author: Faisal Salman <f@faisalman.com>
|
5
5
|
AGPLv3 License */
|
@@ -15,27 +15,29 @@ const { isStandalonePWA } = require('is-standalone-pwa');
|
|
15
15
|
|
16
16
|
const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor;
|
17
17
|
|
18
|
-
const isAppleSilicon = (res) => {
|
18
|
+
const isAppleSilicon = (res, useFeatureDetection) => {
|
19
19
|
if (res.os.is(OS.MACOS)) {
|
20
20
|
if (res.cpu.is(CPU.ARM)) {
|
21
21
|
return true;
|
22
22
|
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
if (useFeatureDetection) {
|
24
|
+
try {
|
25
|
+
const canvas = document.createElement('canvas');
|
26
|
+
const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
27
|
+
const debug = webgl.getExtension('WEBGL_debug_renderer_info');
|
28
|
+
const renderer = webgl.getParameter(debug.UNMASKED_RENDERER_WEBGL);
|
29
|
+
if (renderer.match(/apple m\d/i)) {
|
30
|
+
return true;
|
31
|
+
}
|
32
|
+
} catch {
|
33
|
+
return false;
|
30
34
|
}
|
31
|
-
} catch {
|
32
|
-
return false;
|
33
35
|
}
|
34
36
|
}
|
35
37
|
return false;
|
36
38
|
}
|
37
39
|
|
38
|
-
const isBot = (res) => ['cli', 'crawler', 'fetcher', '
|
40
|
+
const isBot = (res) => ['cli', 'crawler', 'fetcher', 'library'].includes(res.browser.type);
|
39
41
|
|
40
42
|
const isChromeFamily = (res) => res.engine.is(Engine.BLINK);
|
41
43
|
|
@@ -3,7 +3,7 @@
|
|
3
3
|
// Source: /src/helpers/ua-parser-helpers.js
|
4
4
|
|
5
5
|
///////////////////////////////////////////////
|
6
|
-
/* Helpers for UAParser.js v2.0.0-rc.
|
6
|
+
/* Helpers for UAParser.js v2.0.0-rc.3
|
7
7
|
https://github.com/faisalman/ua-parser-js
|
8
8
|
Author: Faisal Salman <f@faisalman.com>
|
9
9
|
AGPLv3 License */
|
@@ -19,27 +19,29 @@ import { isStandalonePWA } from 'is-standalone-pwa';
|
|
19
19
|
|
20
20
|
const getDeviceVendor = (model) => UAParser(`Mozilla/5.0 (Linux; Android 10; ${model}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.0.0 Safari/537.36`).device.vendor;
|
21
21
|
|
22
|
-
const isAppleSilicon = (res) => {
|
22
|
+
const isAppleSilicon = (res, useFeatureDetection) => {
|
23
23
|
if (res.os.is(OS.MACOS)) {
|
24
24
|
if (res.cpu.is(CPU.ARM)) {
|
25
25
|
return true;
|
26
26
|
}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
if (useFeatureDetection) {
|
28
|
+
try {
|
29
|
+
const canvas = document.createElement('canvas');
|
30
|
+
const webgl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
31
|
+
const debug = webgl.getExtension('WEBGL_debug_renderer_info');
|
32
|
+
const renderer = webgl.getParameter(debug.UNMASKED_RENDERER_WEBGL);
|
33
|
+
if (renderer.match(/apple m\d/i)) {
|
34
|
+
return true;
|
35
|
+
}
|
36
|
+
} catch {
|
37
|
+
return false;
|
34
38
|
}
|
35
|
-
} catch {
|
36
|
-
return false;
|
37
39
|
}
|
38
40
|
}
|
39
41
|
return false;
|
40
42
|
}
|
41
43
|
|
42
|
-
const isBot = (res) => ['cli', 'crawler', 'fetcher', '
|
44
|
+
const isBot = (res) => ['cli', 'crawler', 'fetcher', 'library'].includes(res.browser.type);
|
43
45
|
|
44
46
|
const isChromeFamily = (res) => res.engine.is(Engine.BLINK);
|
45
47
|
|
package/src/main/ua-parser.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
// Type definitions for UAParser.js v2.0.0-rc.
|
1
|
+
// Type definitions for UAParser.js v2.0.0-rc.3
|
2
2
|
// Project: https://github.com/faisalman/ua-parser-js
|
3
3
|
// Definitions by: Faisal Salman <https://github.com/faisalman>
|
4
4
|
|
@@ -15,11 +15,11 @@ declare namespace UAParser {
|
|
15
15
|
name?: string;
|
16
16
|
version?: string;
|
17
17
|
major?: string;
|
18
|
-
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | '
|
18
|
+
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'library';
|
19
19
|
}
|
20
20
|
|
21
21
|
interface ICPU extends IData<ICPU> {
|
22
|
-
architecture?: 'ia32' | 'ia64' | 'amd64' | 'arm' | 'arm64' | 'armhf' | 'avr' | 'irix' | 'irix64' | 'mips' | 'mips64' | '68k' | 'ppc' | 'sparc' | 'sparc64';
|
22
|
+
architecture?: 'ia32' | 'ia64' | 'amd64' | 'arm' | 'arm64' | 'armhf' | 'avr' | 'avr32' | 'irix' | 'irix64' | 'mips' | 'mips64' | '68k' | 'pa-risc' | 'ppc' | 'sparc' | 'sparc64';
|
23
23
|
}
|
24
24
|
|
25
25
|
interface IDevice extends IData<IDevice> {
|
@@ -29,7 +29,7 @@ declare namespace UAParser {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
interface IEngine extends IData<IEngine> {
|
32
|
-
name?: 'Amaya' | 'Blink' | 'EdgeHTML' | 'Flow' | 'Gecko' | 'Goanna' | 'iCab' | 'KHTML' | 'LibWeb' | 'Links' | 'Lynx' | 'NetFront' | 'NetSurf' | 'Presto' | 'Tasman' | 'Trident' | 'w3m' | 'WebKit';
|
32
|
+
name?: 'Amaya' | 'ArkWeb' | 'Blink' | 'EdgeHTML' | 'Flow' | 'Gecko' | 'Goanna' | 'iCab' | 'KHTML' | 'LibWeb' | 'Links' | 'Lynx' | 'NetFront' | 'NetSurf' | 'Presto' | 'Servo' | 'Tasman' | 'Trident' | 'w3m' | 'WebKit';
|
33
33
|
version?: string;
|
34
34
|
}
|
35
35
|
|