ua-parser-js 2.0.0-rc.1 → 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.
@@ -1,5 +1,5 @@
1
1
  ///////////////////////////////////////////////
2
- /* Enums for UAParser.js v2.0.0-rc.1
2
+ /* Enums 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 */
@@ -8,8 +8,9 @@
8
8
  /*jshint esversion: 6 */
9
9
 
10
10
  const Browser = Object.freeze({
11
- '2345_EXPLORER': '2345Explorer',
12
- '360': '360 Browser',
11
+ '115': '115',
12
+ '2345': '2345',
13
+ '360': '360',
13
14
  ALIPAY: 'Alipay',
14
15
  AMAYA: 'Amaya',
15
16
  ANDROID: 'Android Browser',
@@ -32,11 +33,11 @@ const Browser = Object.freeze({
32
33
  CHROMIUM: 'Chromium',
33
34
  COBALT: 'Cobalt',
34
35
  COC_COC: 'Coc Coc',
35
- COMODO_DRAGON: 'Comodo Dragon',
36
36
  CONKEROR: 'Conkeror',
37
37
  DILLO: 'Dillo',
38
38
  DOLPHIN: 'Dolphin',
39
39
  DORIS: 'Doris',
40
+ DRAGON: 'Dragon',
40
41
  DUCKDUCKGO: 'DuckDuckGo',
41
42
  EDGE: 'Edge',
42
43
  EPIPHANY: 'Epiphany',
@@ -54,6 +55,7 @@ const Browser = Object.freeze({
54
55
  GOOGLE_SEARCH: 'GSA',
55
56
  HELIO: 'Helio',
56
57
  HEYTAP: 'HeyTap',
58
+ HONOR: 'Honor',
57
59
  HUAWEI: 'Huawei Browser',
58
60
  ICAB: 'iCab',
59
61
  ICE: 'ICE Browser',
@@ -74,6 +76,7 @@ const Browser = Object.freeze({
74
76
  KLARNA: 'Klarna',
75
77
  KINDLE: 'Kindle',
76
78
  LENOVO: 'Smart Lenovo Browser',
79
+ LIBREWOLF: 'LibreWolf',
77
80
  LIEBAO: 'LBBROWSER',
78
81
  LINE: 'Line',
79
82
  LINKEDIN: 'LinkedIn',
@@ -122,7 +125,9 @@ const Browser = Object.freeze({
122
125
  SILK: 'Silk',
123
126
  SKYFIRE: 'Skyfire',
124
127
  SLEIPNIR: 'Sleipnir',
128
+ SLIMBOAT: 'SlimBoat',
125
129
  SLIMBROWSER: 'SlimBrowser',
130
+ SLIMJET: 'Slimjet',
126
131
  SNAPCHAT: 'Snapchat',
127
132
  SOGOU_EXPLORER: 'Sogou Explorer',
128
133
  SOGOU_MOBILE: 'Sogou Mobile',
@@ -154,7 +159,7 @@ const BrowserType = Object.freeze({
154
159
  FETCHER: 'fetcher',
155
160
  INAPP: 'inapp',
156
161
  MEDIAPLAYER: 'mediaplayer',
157
- MODULE: 'module'
162
+ LIBRARY: 'library'
158
163
  });
159
164
 
160
165
  const CPU = Object.freeze({
@@ -190,6 +195,7 @@ const Device = Object.freeze({
190
195
 
191
196
  const Vendor = Object.freeze({
192
197
  ACER: 'Acer',
198
+ ADVAN: 'Advan',
193
199
  ALCATEL: 'Alcatel',
194
200
  APPLE: 'Apple',
195
201
  AMAZON: 'Amazon',
@@ -198,7 +204,9 @@ const Vendor = Object.freeze({
198
204
  ATT: 'AT&T',
199
205
  BENQ: 'BenQ',
200
206
  BLACKBERRY: 'BlackBerry',
207
+ CAT: 'Cat',
201
208
  DELL: 'Dell',
209
+ ENERGIZER: 'Energizer',
202
210
  ESSENTIAL: 'Essential',
203
211
  FACEBOOK: 'Facebook',
204
212
  FAIRPHONE: 'Fairphone',
@@ -208,6 +216,7 @@ const Vendor = Object.freeze({
208
216
  HP: 'HP',
209
217
  HTC: 'HTC',
210
218
  HUAWEI: 'Huawei',
219
+ IMO: 'IMO',
211
220
  INFINIX: 'Infinix',
212
221
  ITEL: 'itel',
213
222
  JOLLA: 'Jolla',
@@ -215,6 +224,7 @@ const Vendor = Object.freeze({
215
224
  LENOVO: 'Lenovo',
216
225
  LG: 'LG',
217
226
  MEIZU: 'Meizu',
227
+ MICROMAX: 'Micromax',
218
228
  MICROSOFT: 'Microsoft',
219
229
  MOTOROLA: 'Motorola',
220
230
  NEXIAN: 'Nexian',
@@ -236,6 +246,7 @@ const Vendor = Object.freeze({
236
246
  SAMSUNG: 'Samsung',
237
247
  SHARP: 'Sharp',
238
248
  SIEMENS: 'Siemens',
249
+ SMARTFREN: 'Smartfren',
239
250
  SONY: 'Sony',
240
251
  SPRINT: 'Sprint',
241
252
  TCL: 'TCL',
@@ -269,6 +280,7 @@ const Engine = Object.freeze({
269
280
  NETFRONT: 'NetFront',
270
281
  NETSURF: 'NetSurf',
271
282
  PRESTO: 'Presto',
283
+ SERVO: 'Servo',
272
284
  TASMAN: 'Tasman',
273
285
  TRIDENT: 'Trident',
274
286
  W3M: 'w3m',
@@ -287,6 +299,10 @@ const OS = Object.freeze({
287
299
  CENTOS: 'CentOS',
288
300
  CHROME_OS: 'Chrome OS',
289
301
  CHROMECAST: 'Chromecast',
302
+ CHROMECAST_ANDROID: 'Chromecast Android',
303
+ CHROMECAST_FUCHSIA: 'Chromecast Fuchsia',
304
+ CHROMECAST_LINUX: 'Chromecast Linux',
305
+ CHROMECAST_SMARTSPEAKER: 'Chromecast SmartSpeaker',
290
306
  CONTIKI: 'Contiki',
291
307
  DEBIAN: 'Debian',
292
308
  DEEPIN: 'Deepin',
@@ -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.1
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 */
@@ -12,8 +12,9 @@
12
12
  /*jshint esversion: 6 */
13
13
 
14
14
  const Browser = Object.freeze({
15
- '2345_EXPLORER': '2345Explorer',
16
- '360': '360 Browser',
15
+ '115': '115',
16
+ '2345': '2345',
17
+ '360': '360',
17
18
  ALIPAY: 'Alipay',
18
19
  AMAYA: 'Amaya',
19
20
  ANDROID: 'Android Browser',
@@ -36,11 +37,11 @@ const Browser = Object.freeze({
36
37
  CHROMIUM: 'Chromium',
37
38
  COBALT: 'Cobalt',
38
39
  COC_COC: 'Coc Coc',
39
- COMODO_DRAGON: 'Comodo Dragon',
40
40
  CONKEROR: 'Conkeror',
41
41
  DILLO: 'Dillo',
42
42
  DOLPHIN: 'Dolphin',
43
43
  DORIS: 'Doris',
44
+ DRAGON: 'Dragon',
44
45
  DUCKDUCKGO: 'DuckDuckGo',
45
46
  EDGE: 'Edge',
46
47
  EPIPHANY: 'Epiphany',
@@ -58,6 +59,7 @@ const Browser = Object.freeze({
58
59
  GOOGLE_SEARCH: 'GSA',
59
60
  HELIO: 'Helio',
60
61
  HEYTAP: 'HeyTap',
62
+ HONOR: 'Honor',
61
63
  HUAWEI: 'Huawei Browser',
62
64
  ICAB: 'iCab',
63
65
  ICE: 'ICE Browser',
@@ -78,6 +80,7 @@ const Browser = Object.freeze({
78
80
  KLARNA: 'Klarna',
79
81
  KINDLE: 'Kindle',
80
82
  LENOVO: 'Smart Lenovo Browser',
83
+ LIBREWOLF: 'LibreWolf',
81
84
  LIEBAO: 'LBBROWSER',
82
85
  LINE: 'Line',
83
86
  LINKEDIN: 'LinkedIn',
@@ -126,7 +129,9 @@ const Browser = Object.freeze({
126
129
  SILK: 'Silk',
127
130
  SKYFIRE: 'Skyfire',
128
131
  SLEIPNIR: 'Sleipnir',
132
+ SLIMBOAT: 'SlimBoat',
129
133
  SLIMBROWSER: 'SlimBrowser',
134
+ SLIMJET: 'Slimjet',
130
135
  SNAPCHAT: 'Snapchat',
131
136
  SOGOU_EXPLORER: 'Sogou Explorer',
132
137
  SOGOU_MOBILE: 'Sogou Mobile',
@@ -158,7 +163,7 @@ const BrowserType = Object.freeze({
158
163
  FETCHER: 'fetcher',
159
164
  INAPP: 'inapp',
160
165
  MEDIAPLAYER: 'mediaplayer',
161
- MODULE: 'module'
166
+ LIBRARY: 'library'
162
167
  });
163
168
 
164
169
  const CPU = Object.freeze({
@@ -194,6 +199,7 @@ const Device = Object.freeze({
194
199
 
195
200
  const Vendor = Object.freeze({
196
201
  ACER: 'Acer',
202
+ ADVAN: 'Advan',
197
203
  ALCATEL: 'Alcatel',
198
204
  APPLE: 'Apple',
199
205
  AMAZON: 'Amazon',
@@ -202,7 +208,9 @@ const Vendor = Object.freeze({
202
208
  ATT: 'AT&T',
203
209
  BENQ: 'BenQ',
204
210
  BLACKBERRY: 'BlackBerry',
211
+ CAT: 'Cat',
205
212
  DELL: 'Dell',
213
+ ENERGIZER: 'Energizer',
206
214
  ESSENTIAL: 'Essential',
207
215
  FACEBOOK: 'Facebook',
208
216
  FAIRPHONE: 'Fairphone',
@@ -212,6 +220,7 @@ const Vendor = Object.freeze({
212
220
  HP: 'HP',
213
221
  HTC: 'HTC',
214
222
  HUAWEI: 'Huawei',
223
+ IMO: 'IMO',
215
224
  INFINIX: 'Infinix',
216
225
  ITEL: 'itel',
217
226
  JOLLA: 'Jolla',
@@ -219,6 +228,7 @@ const Vendor = Object.freeze({
219
228
  LENOVO: 'Lenovo',
220
229
  LG: 'LG',
221
230
  MEIZU: 'Meizu',
231
+ MICROMAX: 'Micromax',
222
232
  MICROSOFT: 'Microsoft',
223
233
  MOTOROLA: 'Motorola',
224
234
  NEXIAN: 'Nexian',
@@ -240,6 +250,7 @@ const Vendor = Object.freeze({
240
250
  SAMSUNG: 'Samsung',
241
251
  SHARP: 'Sharp',
242
252
  SIEMENS: 'Siemens',
253
+ SMARTFREN: 'Smartfren',
243
254
  SONY: 'Sony',
244
255
  SPRINT: 'Sprint',
245
256
  TCL: 'TCL',
@@ -273,6 +284,7 @@ const Engine = Object.freeze({
273
284
  NETFRONT: 'NetFront',
274
285
  NETSURF: 'NetSurf',
275
286
  PRESTO: 'Presto',
287
+ SERVO: 'Servo',
276
288
  TASMAN: 'Tasman',
277
289
  TRIDENT: 'Trident',
278
290
  W3M: 'w3m',
@@ -291,6 +303,10 @@ const OS = Object.freeze({
291
303
  CENTOS: 'CentOS',
292
304
  CHROME_OS: 'Chrome OS',
293
305
  CHROMECAST: 'Chromecast',
306
+ CHROMECAST_ANDROID: 'Chromecast Android',
307
+ CHROMECAST_FUCHSIA: 'Chromecast Fuchsia',
308
+ CHROMECAST_LINUX: 'Chromecast Linux',
309
+ CHROMECAST_SMARTSPEAKER: 'Chromecast SmartSpeaker',
294
310
  CONTIKI: 'Contiki',
295
311
  DEBIAN: 'Debian',
296
312
  DEEPIN: 'Deepin',
@@ -1,4 +1,4 @@
1
- // Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
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 MediaPlayers: UAParserExt;
15
- export const Modules: UAParserExt;
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.1
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 MODULE = 'module';
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
- // OpenAI Search - https://platform.openai.com/docs/bots
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|-extended)?|(?:storebot-)?google(?:-inspectiontool)?)\/?([\w\.]*)/i,
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
- // Bytespider
81
- // Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
82
- [/((?:bytespider|(?=yahoo! )slurp))/i],
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-read-aloud|(?=bot; )snapchat)/i],
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|ia-archiver|facebookexternalhit)/i
256
- // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
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
- // MODULES / LIBRARIES
337
- ///////////////////////
367
+ /////////////
368
+ // LIBRARIES
369
+ //////////////
338
370
 
339
- const Modules = Object.freeze({
371
+ const Libraries = Object.freeze({
340
372
  browser : [
341
373
  // Axios/jsdom/Scrapy
342
- [/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]]
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
- ...Modules.browser
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
- MediaPlayers,
368
- Modules
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.1
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 MODULE = 'module';
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
- // OpenAI Search - https://platform.openai.com/docs/bots
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|-extended)?|(?:storebot-)?google(?:-inspectiontool)?)\/?([\w\.]*)/i,
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
- // Bytespider
85
- // Yahoo! Slurp - http://help.yahoo.com/help/us/ysearch/slurp
86
- [/((?:bytespider|(?=yahoo! )slurp))/i],
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-read-aloud|(?=bot; )snapchat)/i],
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|ia-archiver|facebookexternalhit)/i
260
- // FStream/NativeHost/QuerySeekSpider/IA Archiver/facebookexternalhit
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
- // MODULES / LIBRARIES
341
- ///////////////////////
371
+ /////////////
372
+ // LIBRARIES
373
+ //////////////
342
374
 
343
- const Modules = Object.freeze({
375
+ const Libraries = Object.freeze({
344
376
  browser : [
345
377
  // Axios/jsdom/Scrapy
346
- [/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]]
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
- ...Modules.browser
391
+ ...Libraries.browser
360
392
  ]
361
393
  });
362
394
 
@@ -368,6 +400,6 @@ export {
368
400
  Emails,
369
401
  Fetchers,
370
402
  InApps,
371
- MediaPlayers,
372
- Modules
403
+ Libraries,
404
+ MediaPlayers
373
405
  };
@@ -1,11 +1,12 @@
1
- // Type definitions for Helpers submodule of UAParser.js v2.0.0-beta.3
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
+ declare function isBot(res: IResult): boolean;
9
10
  declare function isChromeFamily(res: IResult): boolean;
10
11
  declare function isElectron(): boolean;
11
12
  declare function isFromEU(): boolean;
@@ -15,6 +16,7 @@ declare function isStandalonePWA(): boolean;
15
16
  export {
16
17
  getDeviceVendor,
17
18
  isAppleSilicon,
19
+ isBot,
18
20
  isChromeFamily,
19
21
  isElectron,
20
22
  isFromEU,