Skip to content

Commit 20a2087

Browse files
authored
fix(chromium): stop remaining startup requests to Google services (#43571)
1 parent 652f4b0 commit 20a2087

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/playwright-core/src/server/chromium/chromiumSwitches.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,22 @@ const disabledFeatures = [
3838
'NetworkTimeServiceQuerying',
3939
// Prevents AI Mode eligibility requests to www.google.com on startup.
4040
'AimEnabled',
41+
// Prevents preconnects to the default search engine (www.google.com) on startup.
42+
// See https://github.com/microsoft/playwright/issues/42910
43+
'PreconnectToSearch',
4144
// Disables forced sign-in in Edge.
4245
'msForceBrowserSignIn',
4346
// Disables updating the preferred version in LaunchServices preferences on mac.
4447
'msEdgeUpdateLaunchServicesPreferredVersion',
4548
].filter(Boolean);
4649

50+
const enabledFeatures = () => [
51+
process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? '' : 'CDPScreenshotNewSurface',
52+
// Prevents /ListAccounts requests to accounts.google.com on startup.
53+
// See https://github.com/microsoft/playwright/issues/42910 and https://issues.chromium.org/565837024
54+
'SkipListAccountsWithoutGaiaCookies',
55+
].filter(Boolean);
56+
4757
export const chromiumSwitches = (options?: { android?: boolean }) => [
4858
'--disable-field-trial-config', // https://source.chromium.org/chromium/chromium/src/+/main:testing/variations/README.md
4959
'--disable-background-networking',
@@ -59,7 +69,7 @@ export const chromiumSwitches = (options?: { android?: boolean }) => [
5969
'--disable-edgeupdater', // Disables Edge-specific updater on mac.
6070
'--disable-extensions',
6171
'--disable-features=' + disabledFeatures.join(','),
62-
process.env.PLAYWRIGHT_LEGACY_SCREENSHOT ? '' : '--enable-features=CDPScreenshotNewSurface',
72+
'--enable-features=' + enabledFeatures().join(','),
6373
'--allow-pre-commit-input',
6474
'--disable-hang-monitor',
6575
'--disable-ipc-flooding-protection',

0 commit comments

Comments
 (0)