Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 17ce008

Browse files
fix: BotReason.ChromeWithoutChrome removed due to false positives
1 parent c8396f9 commit 17ce008

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/bot.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ test('"" languages means bot', () => {
9292
expect(botDetectionService.isBot()).toBe(BotReason.EmptyLanguages)
9393
})
9494

95-
test('Chrome without chrome means bot', () => {
96-
globalThis.navigator = {
97-
userAgent: userAgentChrome,
98-
} as Navigator
99-
expect(botDetectionService.isBot()).toBe(BotReason.ChromeWithoutChrome)
100-
})
95+
// test('Chrome without chrome means bot', () => {
96+
// globalThis.navigator = {
97+
// userAgent: userAgentChrome,
98+
// } as Navigator
99+
// expect(botDetectionService.isBot()).toBe(BotReason.ChromeWithoutChrome)
100+
// })
101101

102102
// This test helps with coverage, while not really testing anything useful
103103
test('cdp in jest looks like a bot, because it does error serialization', () => {

src/bot.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ class BotDetectionService {
4747
// isChrome is true if the browser is Chrome, Chromium or Opera
4848
// this is "the chrome test" from https://intoli.com/blog/not-possible-to-block-chrome-headless/
4949
// this property is for some reason not present by default in headless chrome
50-
if (userAgent.includes('Chrome') && !(globalThis as any).chrome) {
51-
return BotReason.ChromeWithoutChrome // Headless Chrome
52-
}
50+
// Kirill: criterium removed due to false positives with Android
51+
// if (userAgent.includes('Chrome') && !(globalThis as any).chrome) {
52+
// return BotReason.ChromeWithoutChrome // Headless Chrome
53+
// }
5354
}
5455

5556
/**

0 commit comments

Comments
 (0)