feat(stealth): 增强浏览器级 UA 覆盖并修复背景特征

This commit is contained in:
leeguooooo
2026-02-24 14:50:03 +09:00
parent 2ed0c6f8ec
commit c5b2292caa
2 changed files with 109 additions and 28 deletions
+5
View File
@@ -30,6 +30,7 @@ import {
import {
STEALTH_CHROMIUM_ARGS,
applyStealthScripts,
applyBrowserLevelStealth,
type StealthScriptOptions,
} from './stealth.js';
@@ -1576,6 +1577,10 @@ export class BrowserManager {
});
this.cdpEndpoint = null;
if (stealthPolicy.enabled && browserType === 'chromium') {
await applyBrowserLevelStealth(this.browser);
}
if (!options.userAgent && stealthPolicy.enabled && browserType === 'chromium') {
const runtimeVersion = this.extractChromiumVersion(this.browser.version());
if (runtimeVersion) {