feat(puppeteer-core): update Chrome launcher flags (#9239)

This PR adds:
- `--disable-component-update`
- `--disable-features=MediaRouter`
- `--disable-features=OptimizationHints`

and removes `--disable-features=AvoidUnnecessaryBeforeUnloadCheckSync`.

See
https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
This commit is contained in:
Alex Rudenko 2022-11-10 11:43:37 +01:00 committed by GitHub
parent 3f2c0590f1
commit ae87bfc2b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -157,38 +157,38 @@ export class ChromeLauncher extends ProductLauncher {
} }
override defaultArgs(options: BrowserLaunchArgumentOptions = {}): string[] { override defaultArgs(options: BrowserLaunchArgumentOptions = {}): string[] {
// See https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
const chromeArguments = [ const chromeArguments = [
'--allow-pre-commit-input', '--allow-pre-commit-input',
'--disable-background-networking', '--disable-background-networking',
'--enable-features=NetworkServiceInProcess2',
'--disable-background-timer-throttling', '--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows', '--disable-backgrounding-occluded-windows',
'--disable-breakpad', '--disable-breakpad',
'--disable-client-side-phishing-detection', '--disable-client-side-phishing-detection',
'--disable-component-extensions-with-background-pages', '--disable-component-extensions-with-background-pages',
'--disable-component-update',
'--disable-default-apps', '--disable-default-apps',
'--disable-dev-shm-usage', '--disable-dev-shm-usage',
'--disable-extensions', '--disable-extensions',
// TODO: remove AvoidUnnecessaryBeforeUnloadCheckSync below
// once crbug.com/1324138 is fixed and released.
// AcceptCHFrame disabled because of crbug.com/1348106. // AcceptCHFrame disabled because of crbug.com/1348106.
'--disable-features=Translate,BackForwardCache,AcceptCHFrame,AvoidUnnecessaryBeforeUnloadCheckSync', '--disable-features=Translate,BackForwardCache,AcceptCHFrame,MediaRouter,OptimizationHints',
'--disable-hang-monitor', '--disable-hang-monitor',
'--disable-ipc-flooding-protection', '--disable-ipc-flooding-protection',
'--disable-popup-blocking', '--disable-popup-blocking',
'--disable-prompt-on-repost', '--disable-prompt-on-repost',
'--disable-renderer-backgrounding', '--disable-renderer-backgrounding',
'--disable-sync', '--disable-sync',
'--enable-automation',
// TODO(sadym): remove '--enable-blink-features=IdleDetection' once
// IdleDetection is turned on by default.
'--enable-blink-features=IdleDetection',
'--enable-features=NetworkServiceInProcess2',
'--export-tagged-pdf',
'--force-color-profile=srgb', '--force-color-profile=srgb',
'--metrics-recording-only', '--metrics-recording-only',
'--no-first-run', '--no-first-run',
'--enable-automation',
'--password-store=basic', '--password-store=basic',
'--use-mock-keychain', '--use-mock-keychain',
// TODO(sadym): remove '--enable-blink-features=IdleDetection'
// once IdleDetection is turned on by default.
'--enable-blink-features=IdleDetection',
'--export-tagged-pdf',
]; ];
const { const {
devtools = false, devtools = false,