Skip to content

Commit 9234a65

Browse files
feat: Block Lighthouse cryptic user agent
Believe it or not, this is Lighthouse's user agent. They don't usually include "lighthouse" in it anymore because some people were gaming the system for LH scores, so they use some cryptic UAs now. I'll just ignore this outright because not many people will actually have that UA, and this might cause some big bills for some customers.
1 parent b6a1dbb commit 9234a65

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils/blocked-uas.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const DEFAULT_BLOCKED_UA_STRS = [
1717
'bot.php',
1818
'(bot;',
1919
'bot/',
20-
'chrome-lighthouse',
2120
'crawler',
2221
'dataforseobot',
2322
'deepscan',
@@ -80,6 +79,12 @@ export const DEFAULT_BLOCKED_UA_STRS = [
8079
'mediapartners-google',
8180
'storebot-google',
8281
'bytespider',
82+
83+
// Believe it or not, these are all from Lighthouse
84+
// https://github.com/GoogleChrome/lighthouse/blob/main/core/config/constants.js
85+
'chrome-lighthouse',
86+
'moto g power (2022)', // Mobile UA for Lighthouse: Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Mobile Safari/537.36
87+
'Intel Mac OS X 10_15_7', // Desktop UA for Lighthouse: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
8388
]
8489

8590
/**

0 commit comments

Comments
 (0)