mirror of
https://github.com/opelly27/streetmerchant.git
synced 2026-05-20 05:17:35 +00:00
fix(lookup): remove mobile versions of user agent
Removing mobile versions of user agents should help us with false positives, as the mobile version may give different selectors which we cannot parse correctly.
This commit is contained in:
+14
-7
@@ -97,12 +97,19 @@ export async function getRandomUserAgent(): Promise<string> {
|
||||
];
|
||||
}
|
||||
|
||||
const userAgent =
|
||||
return (
|
||||
getRandom((ua) => {
|
||||
return ua.browserName === 'Chrome' && ua.browserVersion > '20';
|
||||
}) ?? config.browser.userAgent;
|
||||
|
||||
logger.debug('user agent', userAgent);
|
||||
|
||||
return userAgent;
|
||||
if (
|
||||
ua.browserName === 'Chrome' &&
|
||||
ua.browserVersion > '40' &&
|
||||
ua.osName !== 'Android' &&
|
||||
ua.osName !== 'iOS'
|
||||
) {
|
||||
logger.debug('user agent', ua);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}) ?? config.browser.userAgent
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user