@shware/analytics 8.14.0 → 8.15.1
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/dist/bot/generic.cjs +225 -0
- package/dist/bot/generic.cjs.map +1 -0
- package/dist/bot/generic.d.cts +13 -0
- package/dist/bot/generic.d.cts.map +1 -0
- package/dist/bot/generic.d.mts +13 -0
- package/dist/bot/generic.d.mts.map +1 -0
- package/dist/bot/generic.mjs +223 -0
- package/dist/bot/generic.mjs.map +1 -0
- package/dist/bot/index.cjs +1189 -0
- package/dist/bot/index.cjs.map +1 -0
- package/dist/bot/index.d.cts +88 -0
- package/dist/bot/index.d.cts.map +1 -0
- package/dist/bot/index.d.mts +88 -0
- package/dist/bot/index.d.mts.map +1 -0
- package/dist/bot/index.mjs +1184 -0
- package/dist/bot/index.mjs.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +2 -1
- package/dist/schema/index.cjs +1 -0
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +6 -0
- package/dist/schema/index.d.cts.map +1 -1
- package/dist/schema/index.d.mts +6 -0
- package/dist/schema/index.d.mts.map +1 -1
- package/dist/schema/index.mjs +1 -0
- package/dist/schema/index.mjs.map +1 -1
- package/dist/track/types.d.cts +2 -0
- package/dist/track/types.d.cts.map +1 -1
- package/dist/track/types.d.mts +2 -0
- package/dist/track/types.d.mts.map +1 -1
- package/dist/web/index.cjs +1 -0
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts.map +1 -1
- package/dist/web/index.d.mts.map +1 -1
- package/dist/web/index.mjs +1 -0
- package/dist/web/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,1189 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_bot_generic = require("./generic.cjs");
|
|
3
|
+
//#region src/bot/index.ts
|
|
4
|
+
/**
|
|
5
|
+
* What kind of automated visitor a bot is, as the analytics tools that report bots separately
|
|
6
|
+
* group them (PostHog's traffic categories, Cloudflare's verified bot categories, Matomo's
|
|
7
|
+
* DeviceDetector). Stored next to the name so dashboards can group without re-deriving:
|
|
8
|
+
*
|
|
9
|
+
* - search_crawler: indexes pages for a search engine (Googlebot, Bingbot, Baiduspider)
|
|
10
|
+
* - ai_crawler: collects content to train models (GPTBot, ClaudeBot, Meta-ExternalAgent)
|
|
11
|
+
* - ai_search: indexes pages for an AI search product (OAI-SearchBot, PerplexityBot)
|
|
12
|
+
* - ai_assistant: fetches a page because a person asked an assistant to (ChatGPT-User)
|
|
13
|
+
* - advertising: works for an ad system — reviews landing pages, targets or verifies ads
|
|
14
|
+
* (Meta-ExternalAds, AdsBot-Google, Mediapartners-Google)
|
|
15
|
+
* - link_preview: renders the card of a link shared in a feed or a chat (facebookexternalhit)
|
|
16
|
+
* - seo_tool: SEO, marketing and page-speed tools (AhrefsBot, Lighthouse, HubSpot)
|
|
17
|
+
* - monitoring: uptime checks, synthetics and service callers (Pingdom, Stripe)
|
|
18
|
+
* - headless_browser: a scripted browser (HeadlessChrome, Playwright, a WebDriver session)
|
|
19
|
+
* - http_client: a library or command-line client (curl, python-requests)
|
|
20
|
+
* - no_user_agent: a request without a user agent, which no browser sends
|
|
21
|
+
* - other: automated by every sign, but none of the above
|
|
22
|
+
*/
|
|
23
|
+
const BOT_CATEGORIES = [
|
|
24
|
+
"search_crawler",
|
|
25
|
+
"ai_crawler",
|
|
26
|
+
"ai_search",
|
|
27
|
+
"ai_assistant",
|
|
28
|
+
"advertising",
|
|
29
|
+
"link_preview",
|
|
30
|
+
"seo_tool",
|
|
31
|
+
"monitoring",
|
|
32
|
+
"headless_browser",
|
|
33
|
+
"http_client",
|
|
34
|
+
"no_user_agent",
|
|
35
|
+
"other"
|
|
36
|
+
];
|
|
37
|
+
const NOT_A_BOT = {
|
|
38
|
+
is_bot: false,
|
|
39
|
+
bot_name: null,
|
|
40
|
+
bot_category: null
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Bots we can name, as `[name, category, pattern]`, tried in order; the first match wins.
|
|
44
|
+
*
|
|
45
|
+
* Where the list comes from (checked 2026-09-30):
|
|
46
|
+
* - bowser's bot parsers (the ~25 named bots its `platform.type === 'bot'` reports), which this
|
|
47
|
+
* replaces.
|
|
48
|
+
* - PostHog's `bot_definitions.py` (web analytics traffic classification), for the bots and
|
|
49
|
+
* categories an analytics product sees most.
|
|
50
|
+
* - ai.robots.txt (`robots.json`), for AI crawlers, search bots, assistants and agents.
|
|
51
|
+
* - The operators' own docs for the big ones: Google's crawler list, OpenAI's and Anthropic's
|
|
52
|
+
* bot pages, Meta's web crawlers, Perplexity, Bing, Apple.
|
|
53
|
+
* - Bots seen in production (Meta-ExternalAds, HubSpot, Bytespider).
|
|
54
|
+
* Every entry was run against the real user agents in crawler-user-agents and PostHog's
|
|
55
|
+
* fixtures, and bowser's browser fixtures were run to check no browser is taken for a bot
|
|
56
|
+
* (Sogou's browser against its spider, Pinterest's in-app browser against its bot); see
|
|
57
|
+
* `index.test.ts` for where to get them.
|
|
58
|
+
*
|
|
59
|
+
* The link above each entry is the operator's page about the bot, else its product page, else
|
|
60
|
+
* its Known Agents profile (knownagents.com, formerly Dark Visitors) when the operator has none.
|
|
61
|
+
*
|
|
62
|
+
* Names are the operators' spelling of their user agent token. Order matters where one token
|
|
63
|
+
* contains another or borrows a name: advertising and SEO tools come before the search engines
|
|
64
|
+
* whose names they carry, and the more specific of Meta's, Anthropic's and Perplexity's tokens
|
|
65
|
+
* come first. The long tail is left to the generic pattern, filed as `other` and named by
|
|
66
|
+
* `nameOfUnknownBot`; add a bot here when it is worth its own category or name in a dashboard.
|
|
67
|
+
*/
|
|
68
|
+
const NAMED_BOTS = [
|
|
69
|
+
[
|
|
70
|
+
"Meta-ExternalAds",
|
|
71
|
+
"advertising",
|
|
72
|
+
/meta-externalads/i
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"facebookcatalog",
|
|
76
|
+
"advertising",
|
|
77
|
+
/facebookcatalog/i
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
"AdsBot-Google",
|
|
81
|
+
"advertising",
|
|
82
|
+
/adsbot-google/i
|
|
83
|
+
],
|
|
84
|
+
[
|
|
85
|
+
"Mediapartners-Google",
|
|
86
|
+
"advertising",
|
|
87
|
+
/mediapartners-google/i
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"AdIdxBot",
|
|
91
|
+
"advertising",
|
|
92
|
+
/adidxbot/i
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
"Google-AdWords",
|
|
96
|
+
"advertising",
|
|
97
|
+
/google-adwords/i
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"Google-Ads-Conversions",
|
|
101
|
+
"advertising",
|
|
102
|
+
/google-ads-conversions/i
|
|
103
|
+
],
|
|
104
|
+
[
|
|
105
|
+
"OAI-AdsBot",
|
|
106
|
+
"advertising",
|
|
107
|
+
/oai-adsbot/i
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
"SnapchatAds",
|
|
111
|
+
"advertising",
|
|
112
|
+
/snapchatads/i
|
|
113
|
+
],
|
|
114
|
+
[
|
|
115
|
+
"Taboolabot",
|
|
116
|
+
"advertising",
|
|
117
|
+
/taboolabot/i
|
|
118
|
+
],
|
|
119
|
+
[
|
|
120
|
+
"ChatGPT-User",
|
|
121
|
+
"ai_assistant",
|
|
122
|
+
/chatgpt-user/i
|
|
123
|
+
],
|
|
124
|
+
[
|
|
125
|
+
"Claude-User",
|
|
126
|
+
"ai_assistant",
|
|
127
|
+
/claude-user/i
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
"Claude-Web",
|
|
131
|
+
"ai_assistant",
|
|
132
|
+
/claude-web/i
|
|
133
|
+
],
|
|
134
|
+
[
|
|
135
|
+
"Perplexity-User",
|
|
136
|
+
"ai_assistant",
|
|
137
|
+
/perplexity-user/i
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
"DuckAssistBot",
|
|
141
|
+
"ai_assistant",
|
|
142
|
+
/duckassistbot/i
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
"Meta-ExternalFetcher",
|
|
146
|
+
"ai_assistant",
|
|
147
|
+
/meta-externalfetcher/i
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"MistralAI-User",
|
|
151
|
+
"ai_assistant",
|
|
152
|
+
/mistralai-user/i
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
"Manus-User",
|
|
156
|
+
"ai_assistant",
|
|
157
|
+
/manus-user/i
|
|
158
|
+
],
|
|
159
|
+
[
|
|
160
|
+
"Shap-User",
|
|
161
|
+
"ai_assistant",
|
|
162
|
+
/shap-user/i
|
|
163
|
+
],
|
|
164
|
+
[
|
|
165
|
+
"QuillBot",
|
|
166
|
+
"ai_assistant",
|
|
167
|
+
/quillbot/i
|
|
168
|
+
],
|
|
169
|
+
[
|
|
170
|
+
"Amzn-User",
|
|
171
|
+
"ai_assistant",
|
|
172
|
+
/amzn-user/i
|
|
173
|
+
],
|
|
174
|
+
[
|
|
175
|
+
"amazon-QBusiness",
|
|
176
|
+
"ai_assistant",
|
|
177
|
+
/amazon-qbusiness/i
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
"Amazon-Bedrock-AgentCore-Browser",
|
|
181
|
+
"ai_assistant",
|
|
182
|
+
/amazon-bedrock-agentcore/i
|
|
183
|
+
],
|
|
184
|
+
[
|
|
185
|
+
"Google-Agent",
|
|
186
|
+
"ai_assistant",
|
|
187
|
+
/google-?agent/i
|
|
188
|
+
],
|
|
189
|
+
[
|
|
190
|
+
"Gemini-Deep-Research",
|
|
191
|
+
"ai_assistant",
|
|
192
|
+
/gemini-deep-research/i
|
|
193
|
+
],
|
|
194
|
+
[
|
|
195
|
+
"Google-NotebookLM",
|
|
196
|
+
"ai_assistant",
|
|
197
|
+
/google-notebooklm/i
|
|
198
|
+
],
|
|
199
|
+
[
|
|
200
|
+
"Kimi-User",
|
|
201
|
+
"ai_assistant",
|
|
202
|
+
/kimi-(?:user|agent)/i
|
|
203
|
+
],
|
|
204
|
+
[
|
|
205
|
+
"TongyiBot",
|
|
206
|
+
"ai_assistant",
|
|
207
|
+
/tongyibot/i
|
|
208
|
+
],
|
|
209
|
+
[
|
|
210
|
+
"YiyanBot",
|
|
211
|
+
"ai_assistant",
|
|
212
|
+
/yiyanbot/i
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
"kagi-fetcher",
|
|
216
|
+
"ai_assistant",
|
|
217
|
+
/kagi-fetcher/i
|
|
218
|
+
],
|
|
219
|
+
[
|
|
220
|
+
"Devin",
|
|
221
|
+
"ai_assistant",
|
|
222
|
+
/\bdevin\/\d/i
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
"NovaAct",
|
|
226
|
+
"ai_assistant",
|
|
227
|
+
/novaact/i
|
|
228
|
+
],
|
|
229
|
+
[
|
|
230
|
+
"OAI-SearchBot",
|
|
231
|
+
"ai_search",
|
|
232
|
+
/oai-searchbot/i
|
|
233
|
+
],
|
|
234
|
+
[
|
|
235
|
+
"Claude-SearchBot",
|
|
236
|
+
"ai_search",
|
|
237
|
+
/claude-searchbot/i
|
|
238
|
+
],
|
|
239
|
+
[
|
|
240
|
+
"PerplexityBot",
|
|
241
|
+
"ai_search",
|
|
242
|
+
/perplexitybot/i
|
|
243
|
+
],
|
|
244
|
+
[
|
|
245
|
+
"Meta-WebIndexer",
|
|
246
|
+
"ai_search",
|
|
247
|
+
/meta-webindexer/i
|
|
248
|
+
],
|
|
249
|
+
[
|
|
250
|
+
"Amazonbot",
|
|
251
|
+
"ai_search",
|
|
252
|
+
/amazonbot/i
|
|
253
|
+
],
|
|
254
|
+
[
|
|
255
|
+
"YouBot",
|
|
256
|
+
"ai_search",
|
|
257
|
+
/youbot/i
|
|
258
|
+
],
|
|
259
|
+
[
|
|
260
|
+
"PhindBot",
|
|
261
|
+
"ai_search",
|
|
262
|
+
/phindbot/i
|
|
263
|
+
],
|
|
264
|
+
[
|
|
265
|
+
"Amzn-SearchBot",
|
|
266
|
+
"ai_search",
|
|
267
|
+
/amzn-searchbot/i
|
|
268
|
+
],
|
|
269
|
+
[
|
|
270
|
+
"AzureAI-SearchBot",
|
|
271
|
+
"ai_search",
|
|
272
|
+
/azureai-searchbot/i
|
|
273
|
+
],
|
|
274
|
+
[
|
|
275
|
+
"Kimi-SearchBot",
|
|
276
|
+
"ai_search",
|
|
277
|
+
/kimi-searchbot/i
|
|
278
|
+
],
|
|
279
|
+
[
|
|
280
|
+
"MistralAI-Index",
|
|
281
|
+
"ai_search",
|
|
282
|
+
/mistralai-index/i
|
|
283
|
+
],
|
|
284
|
+
[
|
|
285
|
+
"ExaSearchBot",
|
|
286
|
+
"ai_search",
|
|
287
|
+
/exasearchbot|\bexabot/i
|
|
288
|
+
],
|
|
289
|
+
[
|
|
290
|
+
"TavilyBot",
|
|
291
|
+
"ai_search",
|
|
292
|
+
/tavilybot/i
|
|
293
|
+
],
|
|
294
|
+
[
|
|
295
|
+
"LinkupBot",
|
|
296
|
+
"ai_search",
|
|
297
|
+
/linkupbot/i
|
|
298
|
+
],
|
|
299
|
+
[
|
|
300
|
+
"iAskBot",
|
|
301
|
+
"ai_search",
|
|
302
|
+
/iask(?:bot|spider)/i
|
|
303
|
+
],
|
|
304
|
+
[
|
|
305
|
+
"Andibot",
|
|
306
|
+
"ai_search",
|
|
307
|
+
/andibot/i
|
|
308
|
+
],
|
|
309
|
+
[
|
|
310
|
+
"Cloudflare-AutoRAG",
|
|
311
|
+
"ai_search",
|
|
312
|
+
/cloudflare-autorag/i
|
|
313
|
+
],
|
|
314
|
+
[
|
|
315
|
+
"ShapBot",
|
|
316
|
+
"ai_search",
|
|
317
|
+
/shapbot/i
|
|
318
|
+
],
|
|
319
|
+
[
|
|
320
|
+
"GPTBot",
|
|
321
|
+
"ai_crawler",
|
|
322
|
+
/gptbot/i
|
|
323
|
+
],
|
|
324
|
+
[
|
|
325
|
+
"ClaudeBot",
|
|
326
|
+
"ai_crawler",
|
|
327
|
+
/claudebot/i
|
|
328
|
+
],
|
|
329
|
+
[
|
|
330
|
+
"anthropic-ai",
|
|
331
|
+
"ai_crawler",
|
|
332
|
+
/anthropic-ai/i
|
|
333
|
+
],
|
|
334
|
+
[
|
|
335
|
+
"Meta-ExternalAgent",
|
|
336
|
+
"ai_crawler",
|
|
337
|
+
/meta-externalagent/i
|
|
338
|
+
],
|
|
339
|
+
[
|
|
340
|
+
"FacebookBot",
|
|
341
|
+
"ai_crawler",
|
|
342
|
+
/facebookbot/i
|
|
343
|
+
],
|
|
344
|
+
[
|
|
345
|
+
"Bytespider",
|
|
346
|
+
"ai_crawler",
|
|
347
|
+
/bytespider/i
|
|
348
|
+
],
|
|
349
|
+
[
|
|
350
|
+
"CCBot",
|
|
351
|
+
"ai_crawler",
|
|
352
|
+
/ccbot/i
|
|
353
|
+
],
|
|
354
|
+
[
|
|
355
|
+
"Google-CloudVertexBot",
|
|
356
|
+
"ai_crawler",
|
|
357
|
+
/google-cloudvertexbot/i
|
|
358
|
+
],
|
|
359
|
+
[
|
|
360
|
+
"cohere-ai",
|
|
361
|
+
"ai_crawler",
|
|
362
|
+
/cohere-(?:ai|training-data-crawler)/i
|
|
363
|
+
],
|
|
364
|
+
[
|
|
365
|
+
"Diffbot",
|
|
366
|
+
"ai_crawler",
|
|
367
|
+
/diffbot/i
|
|
368
|
+
],
|
|
369
|
+
[
|
|
370
|
+
"Omgili",
|
|
371
|
+
"ai_crawler",
|
|
372
|
+
/omgili|webzio-extended/i
|
|
373
|
+
],
|
|
374
|
+
[
|
|
375
|
+
"ImagesiftBot",
|
|
376
|
+
"ai_crawler",
|
|
377
|
+
/imagesiftbot/i
|
|
378
|
+
],
|
|
379
|
+
[
|
|
380
|
+
"Timpibot",
|
|
381
|
+
"ai_crawler",
|
|
382
|
+
/timpibot/i
|
|
383
|
+
],
|
|
384
|
+
[
|
|
385
|
+
"AI2Bot",
|
|
386
|
+
"ai_crawler",
|
|
387
|
+
/ai2bot/i
|
|
388
|
+
],
|
|
389
|
+
[
|
|
390
|
+
"PanguBot",
|
|
391
|
+
"ai_crawler",
|
|
392
|
+
/pangubot/i
|
|
393
|
+
],
|
|
394
|
+
[
|
|
395
|
+
"PromptingBot",
|
|
396
|
+
"ai_crawler",
|
|
397
|
+
/promptingbot/i
|
|
398
|
+
],
|
|
399
|
+
[
|
|
400
|
+
"Reflectionbot",
|
|
401
|
+
"ai_crawler",
|
|
402
|
+
/reflectionbot/i
|
|
403
|
+
],
|
|
404
|
+
[
|
|
405
|
+
"TikTokSpider",
|
|
406
|
+
"ai_crawler",
|
|
407
|
+
/tiktokspider/i
|
|
408
|
+
],
|
|
409
|
+
[
|
|
410
|
+
"DeepSeekBot",
|
|
411
|
+
"ai_crawler",
|
|
412
|
+
/deepseekbot/i
|
|
413
|
+
],
|
|
414
|
+
[
|
|
415
|
+
"DoubaoBot",
|
|
416
|
+
"ai_crawler",
|
|
417
|
+
/doubaobot/i
|
|
418
|
+
],
|
|
419
|
+
[
|
|
420
|
+
"ERNIEBot",
|
|
421
|
+
"ai_crawler",
|
|
422
|
+
/erniebot/i
|
|
423
|
+
],
|
|
424
|
+
[
|
|
425
|
+
"QwenBot",
|
|
426
|
+
"ai_crawler",
|
|
427
|
+
/qwenbot/i
|
|
428
|
+
],
|
|
429
|
+
[
|
|
430
|
+
"KimiBot",
|
|
431
|
+
"ai_crawler",
|
|
432
|
+
/kimibot/i
|
|
433
|
+
],
|
|
434
|
+
[
|
|
435
|
+
"ChatGLM-Spider",
|
|
436
|
+
"ai_crawler",
|
|
437
|
+
/chatglm-spider/i
|
|
438
|
+
],
|
|
439
|
+
[
|
|
440
|
+
"MistralAI-Training",
|
|
441
|
+
"ai_crawler",
|
|
442
|
+
/mistralai-training/i
|
|
443
|
+
],
|
|
444
|
+
[
|
|
445
|
+
"YandexAdditional",
|
|
446
|
+
"ai_crawler",
|
|
447
|
+
/yandexadditional/i
|
|
448
|
+
],
|
|
449
|
+
[
|
|
450
|
+
"Google-Extended",
|
|
451
|
+
"ai_crawler",
|
|
452
|
+
/google-extended/i
|
|
453
|
+
],
|
|
454
|
+
[
|
|
455
|
+
"Amazon Kendra",
|
|
456
|
+
"ai_crawler",
|
|
457
|
+
/amazon-kendra|kendrabot/i
|
|
458
|
+
],
|
|
459
|
+
[
|
|
460
|
+
"bedrockbot",
|
|
461
|
+
"ai_crawler",
|
|
462
|
+
/bedrockbot/i
|
|
463
|
+
],
|
|
464
|
+
[
|
|
465
|
+
"Brightbot",
|
|
466
|
+
"ai_crawler",
|
|
467
|
+
/brightbot/i
|
|
468
|
+
],
|
|
469
|
+
[
|
|
470
|
+
"FirecrawlAgent",
|
|
471
|
+
"ai_crawler",
|
|
472
|
+
/firecrawl/i
|
|
473
|
+
],
|
|
474
|
+
[
|
|
475
|
+
"Crawl4AI",
|
|
476
|
+
"ai_crawler",
|
|
477
|
+
/crawl4ai/i
|
|
478
|
+
],
|
|
479
|
+
[
|
|
480
|
+
"ApifyBot",
|
|
481
|
+
"ai_crawler",
|
|
482
|
+
/apify/i
|
|
483
|
+
],
|
|
484
|
+
[
|
|
485
|
+
"img2dataset",
|
|
486
|
+
"ai_crawler",
|
|
487
|
+
/img2dataset/i
|
|
488
|
+
],
|
|
489
|
+
[
|
|
490
|
+
"LAION",
|
|
491
|
+
"ai_crawler",
|
|
492
|
+
/laion/i
|
|
493
|
+
],
|
|
494
|
+
[
|
|
495
|
+
"Cloudflare Browser Rendering",
|
|
496
|
+
"ai_crawler",
|
|
497
|
+
/cloudflarebrowserrendering/i
|
|
498
|
+
],
|
|
499
|
+
[
|
|
500
|
+
"facebookexternalhit",
|
|
501
|
+
"link_preview",
|
|
502
|
+
/facebookexternalhit/i
|
|
503
|
+
],
|
|
504
|
+
[
|
|
505
|
+
"Facebot",
|
|
506
|
+
"link_preview",
|
|
507
|
+
/facebot/i
|
|
508
|
+
],
|
|
509
|
+
[
|
|
510
|
+
"Twitterbot",
|
|
511
|
+
"link_preview",
|
|
512
|
+
/twitterbot/i
|
|
513
|
+
],
|
|
514
|
+
[
|
|
515
|
+
"LinkedInBot",
|
|
516
|
+
"link_preview",
|
|
517
|
+
/linkedinbot/i
|
|
518
|
+
],
|
|
519
|
+
[
|
|
520
|
+
"Slackbot",
|
|
521
|
+
"link_preview",
|
|
522
|
+
/slackbot|slack-imgproxy/i
|
|
523
|
+
],
|
|
524
|
+
[
|
|
525
|
+
"Discordbot",
|
|
526
|
+
"link_preview",
|
|
527
|
+
/discordbot/i
|
|
528
|
+
],
|
|
529
|
+
[
|
|
530
|
+
"TelegramBot",
|
|
531
|
+
"link_preview",
|
|
532
|
+
/telegrambot/i
|
|
533
|
+
],
|
|
534
|
+
[
|
|
535
|
+
"WhatsApp",
|
|
536
|
+
"link_preview",
|
|
537
|
+
/^whatsapp\//i
|
|
538
|
+
],
|
|
539
|
+
[
|
|
540
|
+
"Pinterestbot",
|
|
541
|
+
"link_preview",
|
|
542
|
+
/pinterestbot|^pinterest\/0\./i
|
|
543
|
+
],
|
|
544
|
+
[
|
|
545
|
+
"redditbot",
|
|
546
|
+
"link_preview",
|
|
547
|
+
/redditbot/i
|
|
548
|
+
],
|
|
549
|
+
[
|
|
550
|
+
"Snap URL Preview",
|
|
551
|
+
"link_preview",
|
|
552
|
+
/snap url preview/i
|
|
553
|
+
],
|
|
554
|
+
[
|
|
555
|
+
"SkypeUriPreview",
|
|
556
|
+
"link_preview",
|
|
557
|
+
/skypeuripreview/i
|
|
558
|
+
],
|
|
559
|
+
[
|
|
560
|
+
"BingPreview",
|
|
561
|
+
"link_preview",
|
|
562
|
+
/bingpreview|microsoftpreview/i
|
|
563
|
+
],
|
|
564
|
+
[
|
|
565
|
+
"Iframely",
|
|
566
|
+
"link_preview",
|
|
567
|
+
/iframely/i
|
|
568
|
+
],
|
|
569
|
+
[
|
|
570
|
+
"Embedly",
|
|
571
|
+
"link_preview",
|
|
572
|
+
/embedly/i
|
|
573
|
+
],
|
|
574
|
+
[
|
|
575
|
+
"KakaoTalk-scrap",
|
|
576
|
+
"link_preview",
|
|
577
|
+
/kakaotalk-scrap/i
|
|
578
|
+
],
|
|
579
|
+
[
|
|
580
|
+
"vkShare",
|
|
581
|
+
"link_preview",
|
|
582
|
+
/vkshare/i
|
|
583
|
+
],
|
|
584
|
+
[
|
|
585
|
+
"Viber",
|
|
586
|
+
"link_preview",
|
|
587
|
+
/^viber\b|viber-crawler/i
|
|
588
|
+
],
|
|
589
|
+
[
|
|
590
|
+
"Bluesky Cardyb",
|
|
591
|
+
"link_preview",
|
|
592
|
+
/cardyb/i
|
|
593
|
+
],
|
|
594
|
+
[
|
|
595
|
+
"Google-PageRenderer",
|
|
596
|
+
"link_preview",
|
|
597
|
+
/google-pagerenderer/i
|
|
598
|
+
],
|
|
599
|
+
[
|
|
600
|
+
"vercel-screenshot",
|
|
601
|
+
"link_preview",
|
|
602
|
+
/vercel-screenshot/i
|
|
603
|
+
],
|
|
604
|
+
[
|
|
605
|
+
"Google-InspectionTool",
|
|
606
|
+
"seo_tool",
|
|
607
|
+
/google-inspectiontool/i
|
|
608
|
+
],
|
|
609
|
+
[
|
|
610
|
+
"Lighthouse",
|
|
611
|
+
"seo_tool",
|
|
612
|
+
/chrome-lighthouse|google page speed insights/i
|
|
613
|
+
],
|
|
614
|
+
[
|
|
615
|
+
"GTmetrix",
|
|
616
|
+
"seo_tool",
|
|
617
|
+
/gtmetrix/i
|
|
618
|
+
],
|
|
619
|
+
[
|
|
620
|
+
"AhrefsBot",
|
|
621
|
+
"seo_tool",
|
|
622
|
+
/ahrefs(?:bot|siteaudit)/i
|
|
623
|
+
],
|
|
624
|
+
[
|
|
625
|
+
"SemrushBot",
|
|
626
|
+
"seo_tool",
|
|
627
|
+
/semrush/i
|
|
628
|
+
],
|
|
629
|
+
[
|
|
630
|
+
"MJ12bot",
|
|
631
|
+
"seo_tool",
|
|
632
|
+
/mj12bot/i
|
|
633
|
+
],
|
|
634
|
+
[
|
|
635
|
+
"DotBot",
|
|
636
|
+
"seo_tool",
|
|
637
|
+
/dotbot/i
|
|
638
|
+
],
|
|
639
|
+
[
|
|
640
|
+
"rogerbot",
|
|
641
|
+
"seo_tool",
|
|
642
|
+
/rogerbot/i
|
|
643
|
+
],
|
|
644
|
+
[
|
|
645
|
+
"Screaming Frog",
|
|
646
|
+
"seo_tool",
|
|
647
|
+
/screaming frog/i
|
|
648
|
+
],
|
|
649
|
+
[
|
|
650
|
+
"SerpstatBot",
|
|
651
|
+
"seo_tool",
|
|
652
|
+
/serpstatbot/i
|
|
653
|
+
],
|
|
654
|
+
[
|
|
655
|
+
"BLEXBot",
|
|
656
|
+
"seo_tool",
|
|
657
|
+
/blexbot/i
|
|
658
|
+
],
|
|
659
|
+
[
|
|
660
|
+
"DataForSeoBot",
|
|
661
|
+
"seo_tool",
|
|
662
|
+
/dataforseobot/i
|
|
663
|
+
],
|
|
664
|
+
[
|
|
665
|
+
"HubSpot",
|
|
666
|
+
"seo_tool",
|
|
667
|
+
/hubspot/i
|
|
668
|
+
],
|
|
669
|
+
[
|
|
670
|
+
"Google-Structured-Data-Testing-Tool",
|
|
671
|
+
"seo_tool",
|
|
672
|
+
/google-structured-data-testing-tool/i
|
|
673
|
+
],
|
|
674
|
+
[
|
|
675
|
+
"WebPageTest",
|
|
676
|
+
"seo_tool",
|
|
677
|
+
/\bptst\/\d/i
|
|
678
|
+
],
|
|
679
|
+
[
|
|
680
|
+
"DareBoost",
|
|
681
|
+
"seo_tool",
|
|
682
|
+
/dareboost/i
|
|
683
|
+
],
|
|
684
|
+
[
|
|
685
|
+
"Barkrowler",
|
|
686
|
+
"seo_tool",
|
|
687
|
+
/barkrowler/i
|
|
688
|
+
],
|
|
689
|
+
[
|
|
690
|
+
"SE Ranking",
|
|
691
|
+
"seo_tool",
|
|
692
|
+
/seranking|sebot-wa/i
|
|
693
|
+
],
|
|
694
|
+
[
|
|
695
|
+
"BrightEdge",
|
|
696
|
+
"seo_tool",
|
|
697
|
+
/brightedge/i
|
|
698
|
+
],
|
|
699
|
+
[
|
|
700
|
+
"SearchAtlas",
|
|
701
|
+
"seo_tool",
|
|
702
|
+
/searchatlas/i
|
|
703
|
+
],
|
|
704
|
+
[
|
|
705
|
+
"Siteimprove",
|
|
706
|
+
"seo_tool",
|
|
707
|
+
/siteimprove/i
|
|
708
|
+
],
|
|
709
|
+
[
|
|
710
|
+
"Dataprovider",
|
|
711
|
+
"seo_tool",
|
|
712
|
+
/dataprovider\.com/i
|
|
713
|
+
],
|
|
714
|
+
[
|
|
715
|
+
"Meltwater",
|
|
716
|
+
"seo_tool",
|
|
717
|
+
/meltwater/i
|
|
718
|
+
],
|
|
719
|
+
[
|
|
720
|
+
"Awario",
|
|
721
|
+
"seo_tool",
|
|
722
|
+
/awario/i
|
|
723
|
+
],
|
|
724
|
+
[
|
|
725
|
+
"Googlebot",
|
|
726
|
+
"search_crawler",
|
|
727
|
+
/googlebot/i
|
|
728
|
+
],
|
|
729
|
+
[
|
|
730
|
+
"Storebot-Google",
|
|
731
|
+
"search_crawler",
|
|
732
|
+
/storebot-google/i
|
|
733
|
+
],
|
|
734
|
+
[
|
|
735
|
+
"GoogleOther",
|
|
736
|
+
"search_crawler",
|
|
737
|
+
/googleother/i
|
|
738
|
+
],
|
|
739
|
+
[
|
|
740
|
+
"Bingbot",
|
|
741
|
+
"search_crawler",
|
|
742
|
+
/bingbot/i
|
|
743
|
+
],
|
|
744
|
+
[
|
|
745
|
+
"Applebot",
|
|
746
|
+
"search_crawler",
|
|
747
|
+
/applebot/i
|
|
748
|
+
],
|
|
749
|
+
[
|
|
750
|
+
"Baiduspider",
|
|
751
|
+
"search_crawler",
|
|
752
|
+
/baiduspider/i
|
|
753
|
+
],
|
|
754
|
+
[
|
|
755
|
+
"YandexBot",
|
|
756
|
+
"search_crawler",
|
|
757
|
+
/yandex(?:\w*bot|images|metrika)/i
|
|
758
|
+
],
|
|
759
|
+
[
|
|
760
|
+
"DuckDuckBot",
|
|
761
|
+
"search_crawler",
|
|
762
|
+
/duckduckbot/i
|
|
763
|
+
],
|
|
764
|
+
[
|
|
765
|
+
"Yahoo Slurp",
|
|
766
|
+
"search_crawler",
|
|
767
|
+
/yahoo!?[\s/]*slurp/i
|
|
768
|
+
],
|
|
769
|
+
[
|
|
770
|
+
"Sogou",
|
|
771
|
+
"search_crawler",
|
|
772
|
+
/sogou[\w\s-]*spider/i
|
|
773
|
+
],
|
|
774
|
+
[
|
|
775
|
+
"360Spider",
|
|
776
|
+
"search_crawler",
|
|
777
|
+
/360spider|haosouspider/i
|
|
778
|
+
],
|
|
779
|
+
[
|
|
780
|
+
"YisouSpider",
|
|
781
|
+
"search_crawler",
|
|
782
|
+
/yisouspider/i
|
|
783
|
+
],
|
|
784
|
+
[
|
|
785
|
+
"PetalBot",
|
|
786
|
+
"search_crawler",
|
|
787
|
+
/petalbot/i
|
|
788
|
+
],
|
|
789
|
+
[
|
|
790
|
+
"SeznamBot",
|
|
791
|
+
"search_crawler",
|
|
792
|
+
/seznambot/i
|
|
793
|
+
],
|
|
794
|
+
[
|
|
795
|
+
"Yeti",
|
|
796
|
+
"search_crawler",
|
|
797
|
+
/\byeti\//i
|
|
798
|
+
],
|
|
799
|
+
[
|
|
800
|
+
"Linespider",
|
|
801
|
+
"search_crawler",
|
|
802
|
+
/linespider/i
|
|
803
|
+
],
|
|
804
|
+
[
|
|
805
|
+
"Qwantbot",
|
|
806
|
+
"search_crawler",
|
|
807
|
+
/qwant(?:bot|ify)/i
|
|
808
|
+
],
|
|
809
|
+
[
|
|
810
|
+
"coccocbot",
|
|
811
|
+
"search_crawler",
|
|
812
|
+
/coccocbot/i
|
|
813
|
+
],
|
|
814
|
+
[
|
|
815
|
+
"MojeekBot",
|
|
816
|
+
"search_crawler",
|
|
817
|
+
/mojeekbot/i
|
|
818
|
+
],
|
|
819
|
+
[
|
|
820
|
+
"Bravebot",
|
|
821
|
+
"search_crawler",
|
|
822
|
+
/bravebot/i
|
|
823
|
+
],
|
|
824
|
+
[
|
|
825
|
+
"SeekportBot",
|
|
826
|
+
"search_crawler",
|
|
827
|
+
/seekport/i
|
|
828
|
+
],
|
|
829
|
+
[
|
|
830
|
+
"mwmbl",
|
|
831
|
+
"search_crawler",
|
|
832
|
+
/mwmbl/i
|
|
833
|
+
],
|
|
834
|
+
[
|
|
835
|
+
"Internet Archive",
|
|
836
|
+
"search_crawler",
|
|
837
|
+
/archive\.org_bot|ia_archiver|archive-it|archiveteam/i
|
|
838
|
+
],
|
|
839
|
+
[
|
|
840
|
+
"Pingdom",
|
|
841
|
+
"monitoring",
|
|
842
|
+
/pingdom/i
|
|
843
|
+
],
|
|
844
|
+
[
|
|
845
|
+
"UptimeRobot",
|
|
846
|
+
"monitoring",
|
|
847
|
+
/uptimerobot/i
|
|
848
|
+
],
|
|
849
|
+
[
|
|
850
|
+
"StatusCake",
|
|
851
|
+
"monitoring",
|
|
852
|
+
/statuscake/i
|
|
853
|
+
],
|
|
854
|
+
[
|
|
855
|
+
"Site24x7",
|
|
856
|
+
"monitoring",
|
|
857
|
+
/site24x7/i
|
|
858
|
+
],
|
|
859
|
+
[
|
|
860
|
+
"Better Stack",
|
|
861
|
+
"monitoring",
|
|
862
|
+
/better ?uptime|betterstack/i
|
|
863
|
+
],
|
|
864
|
+
[
|
|
865
|
+
"Datadog",
|
|
866
|
+
"monitoring",
|
|
867
|
+
/datadog/i
|
|
868
|
+
],
|
|
869
|
+
[
|
|
870
|
+
"Checkly",
|
|
871
|
+
"monitoring",
|
|
872
|
+
/checkly/i
|
|
873
|
+
],
|
|
874
|
+
[
|
|
875
|
+
"NewRelicPinger",
|
|
876
|
+
"monitoring",
|
|
877
|
+
/newrelicpinger/i
|
|
878
|
+
],
|
|
879
|
+
[
|
|
880
|
+
"Uptime-Kuma",
|
|
881
|
+
"monitoring",
|
|
882
|
+
/uptime-kuma/i
|
|
883
|
+
],
|
|
884
|
+
[
|
|
885
|
+
"Grafana Synthetic Monitoring",
|
|
886
|
+
"monitoring",
|
|
887
|
+
/grafanasyntheticmonitoring/i
|
|
888
|
+
],
|
|
889
|
+
[
|
|
890
|
+
"Dynatrace",
|
|
891
|
+
"monitoring",
|
|
892
|
+
/ruxitsynthetic|dynatrace/i
|
|
893
|
+
],
|
|
894
|
+
[
|
|
895
|
+
"Splunk",
|
|
896
|
+
"monitoring",
|
|
897
|
+
/splunk/i
|
|
898
|
+
],
|
|
899
|
+
[
|
|
900
|
+
"Catchpoint",
|
|
901
|
+
"monitoring",
|
|
902
|
+
/catchpoint/i
|
|
903
|
+
],
|
|
904
|
+
[
|
|
905
|
+
"Ghost Inspector",
|
|
906
|
+
"monitoring",
|
|
907
|
+
/ghost inspector/i
|
|
908
|
+
],
|
|
909
|
+
[
|
|
910
|
+
"DigitalOcean Uptime",
|
|
911
|
+
"monitoring",
|
|
912
|
+
/digitalocean uptime/i
|
|
913
|
+
],
|
|
914
|
+
[
|
|
915
|
+
"OhDear",
|
|
916
|
+
"monitoring",
|
|
917
|
+
/ohdear/i
|
|
918
|
+
],
|
|
919
|
+
[
|
|
920
|
+
"Google-Safety",
|
|
921
|
+
"monitoring",
|
|
922
|
+
/google-safety/i
|
|
923
|
+
],
|
|
924
|
+
[
|
|
925
|
+
"Cookiebot",
|
|
926
|
+
"monitoring",
|
|
927
|
+
/cookiebot/i
|
|
928
|
+
],
|
|
929
|
+
[
|
|
930
|
+
"OneTrust",
|
|
931
|
+
"monitoring",
|
|
932
|
+
/onetrust/i
|
|
933
|
+
],
|
|
934
|
+
[
|
|
935
|
+
"CookieHub",
|
|
936
|
+
"monitoring",
|
|
937
|
+
/cookiehub/i
|
|
938
|
+
],
|
|
939
|
+
[
|
|
940
|
+
"Detectify",
|
|
941
|
+
"monitoring",
|
|
942
|
+
/detectify/i
|
|
943
|
+
],
|
|
944
|
+
[
|
|
945
|
+
"CensysInspect",
|
|
946
|
+
"monitoring",
|
|
947
|
+
/censysinspect/i
|
|
948
|
+
],
|
|
949
|
+
[
|
|
950
|
+
"BitSightBot",
|
|
951
|
+
"monitoring",
|
|
952
|
+
/bitsightbot/i
|
|
953
|
+
],
|
|
954
|
+
[
|
|
955
|
+
"zgrab",
|
|
956
|
+
"monitoring",
|
|
957
|
+
/zgrab/i
|
|
958
|
+
],
|
|
959
|
+
[
|
|
960
|
+
"Nmap",
|
|
961
|
+
"monitoring",
|
|
962
|
+
/nmap scripting engine/i
|
|
963
|
+
],
|
|
964
|
+
[
|
|
965
|
+
"Stripe",
|
|
966
|
+
"monitoring",
|
|
967
|
+
/stripe\/1\.0|stripebot|merchantsecurityscanner/i
|
|
968
|
+
],
|
|
969
|
+
[
|
|
970
|
+
"HeadlessChrome",
|
|
971
|
+
"headless_browser",
|
|
972
|
+
/headlesschrome/i
|
|
973
|
+
],
|
|
974
|
+
[
|
|
975
|
+
"PhantomJS",
|
|
976
|
+
"headless_browser",
|
|
977
|
+
/phantomjs/i
|
|
978
|
+
],
|
|
979
|
+
[
|
|
980
|
+
"SlimerJS",
|
|
981
|
+
"headless_browser",
|
|
982
|
+
/slimerjs/i
|
|
983
|
+
],
|
|
984
|
+
[
|
|
985
|
+
"Playwright",
|
|
986
|
+
"headless_browser",
|
|
987
|
+
/playwright/i
|
|
988
|
+
],
|
|
989
|
+
[
|
|
990
|
+
"Puppeteer",
|
|
991
|
+
"headless_browser",
|
|
992
|
+
/puppeteer/i
|
|
993
|
+
],
|
|
994
|
+
[
|
|
995
|
+
"Selenium",
|
|
996
|
+
"headless_browser",
|
|
997
|
+
/selenium/i
|
|
998
|
+
],
|
|
999
|
+
[
|
|
1000
|
+
"Cypress",
|
|
1001
|
+
"headless_browser",
|
|
1002
|
+
/cypress/i
|
|
1003
|
+
],
|
|
1004
|
+
[
|
|
1005
|
+
"Lightpanda",
|
|
1006
|
+
"headless_browser",
|
|
1007
|
+
/lightpanda/i
|
|
1008
|
+
],
|
|
1009
|
+
[
|
|
1010
|
+
"wkhtmltopdf",
|
|
1011
|
+
"headless_browser",
|
|
1012
|
+
/wkhtmltopdf/i
|
|
1013
|
+
],
|
|
1014
|
+
[
|
|
1015
|
+
"curl",
|
|
1016
|
+
"http_client",
|
|
1017
|
+
/^curl\//i
|
|
1018
|
+
],
|
|
1019
|
+
[
|
|
1020
|
+
"Wget",
|
|
1021
|
+
"http_client",
|
|
1022
|
+
/^wget\//i
|
|
1023
|
+
],
|
|
1024
|
+
[
|
|
1025
|
+
"python-requests",
|
|
1026
|
+
"http_client",
|
|
1027
|
+
/python-requests/i
|
|
1028
|
+
],
|
|
1029
|
+
[
|
|
1030
|
+
"python-urllib",
|
|
1031
|
+
"http_client",
|
|
1032
|
+
/python-urllib/i
|
|
1033
|
+
],
|
|
1034
|
+
[
|
|
1035
|
+
"aiohttp",
|
|
1036
|
+
"http_client",
|
|
1037
|
+
/aiohttp/i
|
|
1038
|
+
],
|
|
1039
|
+
[
|
|
1040
|
+
"httpx",
|
|
1041
|
+
"http_client",
|
|
1042
|
+
/python-httpx|^httpx\//i
|
|
1043
|
+
],
|
|
1044
|
+
[
|
|
1045
|
+
"Scrapy",
|
|
1046
|
+
"http_client",
|
|
1047
|
+
/scrapy/i
|
|
1048
|
+
],
|
|
1049
|
+
[
|
|
1050
|
+
"Go-http-client",
|
|
1051
|
+
"http_client",
|
|
1052
|
+
/go-http-client/i
|
|
1053
|
+
],
|
|
1054
|
+
[
|
|
1055
|
+
"okhttp",
|
|
1056
|
+
"http_client",
|
|
1057
|
+
/^okhttp\//i
|
|
1058
|
+
],
|
|
1059
|
+
[
|
|
1060
|
+
"Java",
|
|
1061
|
+
"http_client",
|
|
1062
|
+
/^java\/|apache-httpclient/i
|
|
1063
|
+
],
|
|
1064
|
+
[
|
|
1065
|
+
"axios",
|
|
1066
|
+
"http_client",
|
|
1067
|
+
/^axios\//i
|
|
1068
|
+
],
|
|
1069
|
+
[
|
|
1070
|
+
"node-fetch",
|
|
1071
|
+
"http_client",
|
|
1072
|
+
/node-fetch/i
|
|
1073
|
+
],
|
|
1074
|
+
[
|
|
1075
|
+
"undici",
|
|
1076
|
+
"http_client",
|
|
1077
|
+
/^undici/i
|
|
1078
|
+
],
|
|
1079
|
+
[
|
|
1080
|
+
"PostmanRuntime",
|
|
1081
|
+
"http_client",
|
|
1082
|
+
/postmanruntime/i
|
|
1083
|
+
],
|
|
1084
|
+
[
|
|
1085
|
+
"insomnia",
|
|
1086
|
+
"http_client",
|
|
1087
|
+
/^insomnia\//i
|
|
1088
|
+
],
|
|
1089
|
+
[
|
|
1090
|
+
"libwww-perl",
|
|
1091
|
+
"http_client",
|
|
1092
|
+
/libwww-perl/i
|
|
1093
|
+
],
|
|
1094
|
+
[
|
|
1095
|
+
"Guzzle",
|
|
1096
|
+
"http_client",
|
|
1097
|
+
/guzzlehttp/i
|
|
1098
|
+
],
|
|
1099
|
+
[
|
|
1100
|
+
"Google-Apps-Script",
|
|
1101
|
+
"http_client",
|
|
1102
|
+
/google-apps-script/i
|
|
1103
|
+
],
|
|
1104
|
+
[
|
|
1105
|
+
"GoogleDocs",
|
|
1106
|
+
"http_client",
|
|
1107
|
+
/googledocs/i
|
|
1108
|
+
]
|
|
1109
|
+
];
|
|
1110
|
+
const botishToken = /\b([\w.-]*?(?:bot|crawler|spider|scraper|fetcher|agent|preview|checker|monitor)[\w-]*)\b/i;
|
|
1111
|
+
const botishWord = /^(?:bot|crawler|spider|scraper|fetcher|agent|preview|checker|monitor)$/i;
|
|
1112
|
+
const compatibleToken = /compatible;\s*([a-z][\w.-]*(?: [a-z][\w.-]*)?)/i;
|
|
1113
|
+
const productTokens = /([a-z][\w.-]*)\/\d/gi;
|
|
1114
|
+
const browserToken = /^(?:mozilla|applewebkit|khtml|gecko|chrome|chromium|safari|version|mobile|firefox|edg|edge|opr|msie|trident)$/i;
|
|
1115
|
+
/**
|
|
1116
|
+
* A name for a bot that is not in the named table, from the first of: a token that sounds like
|
|
1117
|
+
* one (`Bytespider`, `ABEvalBot`), the name after `compatible;` (`Google-Read-Aloud`), a product
|
|
1118
|
+
* token that is not a browser's (`Barkrowler/0.5`), what the generic pattern matched. URLs and
|
|
1119
|
+
* email addresses are dropped first, as nearly every crawler links its docs.
|
|
1120
|
+
*/
|
|
1121
|
+
function nameOfUnknownBot(userAgent, matched) {
|
|
1122
|
+
const text = userAgent.replace(/\+?https?:\/\/\S+/gi, " ").replace(/[\w.+-]+@[\w-]+(?:\.[\w-]+)+/g, " ");
|
|
1123
|
+
const botish = botishToken.exec(text)?.[1];
|
|
1124
|
+
if (botish && !botishWord.test(botish)) return botish.slice(0, 64);
|
|
1125
|
+
const compatible = compatibleToken.exec(text)?.[1];
|
|
1126
|
+
if (compatible && !browserToken.test(compatible)) return compatible.slice(0, 64);
|
|
1127
|
+
for (const [, product] of text.matchAll(productTokens)) if (!browserToken.test(product)) return product.slice(0, 64);
|
|
1128
|
+
return matched.replace(/^\W+|\W+$/g, "").slice(0, 64) || "unknown";
|
|
1129
|
+
}
|
|
1130
|
+
/**
|
|
1131
|
+
* The request user agent of a page opened in Facebook's or Instagram's in-app browser when the
|
|
1132
|
+
* app sends the page's requests through its own network stack: `[FBAN/FB4A;FBAV/…]`,
|
|
1133
|
+
* `Instagram 445.0.0.34.44 (iPhone18,1; iOS 26_6_1; …) AppleWebKit/420+`. The page itself still
|
|
1134
|
+
* reads a browser's `navigator.userAgent`, which is why PostHog, GA4 and Matomo see a person.
|
|
1135
|
+
* isbot's generic pattern takes both for bots (a long token with no space, a product token that is
|
|
1136
|
+
* no browser's), so they are people here before it runs. Meta's ad prefetch loads only the HTML,
|
|
1137
|
+
* which runs no script and creates no visitor. The in-app browser's own user agent starts with
|
|
1138
|
+
* `Mozilla/5.0`, so the anchors leave it alone.
|
|
1139
|
+
*/
|
|
1140
|
+
const META_APP = /^\[FBAN\/|^Instagram \d+(?:\.\d+)+ \(/;
|
|
1141
|
+
/**
|
|
1142
|
+
* Whether a web visitor is a bot, which one, and what kind. Run on the server when the visitor
|
|
1143
|
+
* is created, with the tags it was created with: the user agent is the request's header
|
|
1144
|
+
* (`tags.user_agent`, which the server writes), not anything the client says about itself, so
|
|
1145
|
+
* the verdict can be recomputed from stored tags when the rules change.
|
|
1146
|
+
*
|
|
1147
|
+
* Call it for web visitors only: a native app's requests carry an HTTP library's user agent
|
|
1148
|
+
* (CFNetwork, okhttp) that would read as a bot, and no crawler runs the app.
|
|
1149
|
+
*
|
|
1150
|
+
* In order: a bot we can name; a browser driven by WebDriver (`tags.webdriver`, which the SDK
|
|
1151
|
+
* sets from `navigator.webdriver`, the one sign a scripted browser with a normal user agent
|
|
1152
|
+
* gives); a person in a Meta app (`META_APP`); anything the generic pattern calls automated; no
|
|
1153
|
+
* user agent at all.
|
|
1154
|
+
*/
|
|
1155
|
+
function botOf(tags) {
|
|
1156
|
+
const userAgent = typeof tags.user_agent === "string" ? tags.user_agent.trim() : "";
|
|
1157
|
+
for (const [name, category, pattern] of NAMED_BOTS) if (pattern.test(userAgent)) return {
|
|
1158
|
+
is_bot: true,
|
|
1159
|
+
bot_name: name,
|
|
1160
|
+
bot_category: category
|
|
1161
|
+
};
|
|
1162
|
+
const generic = userAgent ? require_bot_generic.GENERIC_BOT.exec(userAgent) : null;
|
|
1163
|
+
const unknownName = generic ? nameOfUnknownBot(userAgent, generic[0]) : null;
|
|
1164
|
+
if (tags.webdriver === true) return {
|
|
1165
|
+
is_bot: true,
|
|
1166
|
+
bot_name: unknownName ?? "WebDriver",
|
|
1167
|
+
bot_category: "headless_browser"
|
|
1168
|
+
};
|
|
1169
|
+
if (META_APP.test(userAgent)) return NOT_A_BOT;
|
|
1170
|
+
if (unknownName) return {
|
|
1171
|
+
is_bot: true,
|
|
1172
|
+
bot_name: unknownName,
|
|
1173
|
+
bot_category: "other"
|
|
1174
|
+
};
|
|
1175
|
+
if (!userAgent) return {
|
|
1176
|
+
is_bot: true,
|
|
1177
|
+
bot_name: "(no user agent)",
|
|
1178
|
+
bot_category: "no_user_agent"
|
|
1179
|
+
};
|
|
1180
|
+
return NOT_A_BOT;
|
|
1181
|
+
}
|
|
1182
|
+
//#endregion
|
|
1183
|
+
exports.BOT_CATEGORIES = BOT_CATEGORIES;
|
|
1184
|
+
exports.NAMED_BOTS = NAMED_BOTS;
|
|
1185
|
+
exports.NOT_A_BOT = NOT_A_BOT;
|
|
1186
|
+
exports.botOf = botOf;
|
|
1187
|
+
exports.nameOfUnknownBot = nameOfUnknownBot;
|
|
1188
|
+
|
|
1189
|
+
//# sourceMappingURL=index.cjs.map
|