Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(chromium): stop remaining startup requests to Google services (#43571)

Yury Semikhatsky20a2087ea434
diff --git a/packages/playwright-core/src/server/chromium/chromiumSwitches.ts b/packages/playwright-core/src/server/chromium/chromiumSwitches.ts
index b3973be72d..f39f2e5610 100644
--- a/packages/playwright-core/src/server/chromium/chromiumSwitches.ts
+++ b/packages/playwright-core/src/server/chromium/chromiumSwitches.ts
@@ -38,12 +38,22 @@ const disabledFeatures = [
'NetworkTimeServiceQuerying',
// Prevents AI Mode eligibility requests to www.google.com on startup.
'AimEnabled',
+ // Prevents preconnects to the default search engine (www.google.com) on startup.
+ // See https://github.com/microsoft/playwright/issues/42910
+ 'PreconnectToSearch',
// Disables forced sign-in in Edge.
'msForceBrowserSignIn',
// Disables updating the preferred version in LaunchServices preferences on mac.
'msEdgeUpdateLaunchServicesPreferredVersion',
].filter(Boolean);
+const enabledFeatures = () => [
+ process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? '' : 'CDPScreenshotNewSurface',
+ // Prevents /ListAccounts requests to accounts.google.com on startup.
+ // See https://github.com/microsoft/playwright/issues/42910 and https://issues.chromium.org/565837024
+ 'SkipListAccountsWithoutGaiaCookies',
+].filter(Boolean);
+
export const chromiumSwitches = (options?: { android?: boolean }) => [
'--disable-field-trial-config', // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
'--disable-background-networking',
@@ -59,7 +69,7 @@ export const chromiumSwitches = (options?: { android?: boolean }) => [
'--disable-edgeupdater', // Disables Edge-specific updater on mac.
'--disable-extensions',
'--disable-features=' + disabledFeatures.join(','),
- process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? '' : '--enable-features=CDPScreenshotNewSurface',
+ '--enable-features=' + enabledFeatures().join(','),
'--allow-pre-commit-input',
'--disable-hang-monitor',
'--disable-ipc-flooding-protection',