From 17a24542267628d1fb67b5532e364f9523d8b74e Mon Sep 17 00:00:00 2001 From: divdavem Date: Fri, 19 Nov 2021 00:41:16 +0100 Subject: [PATCH] feat(cli): add --proxy-bypass option (#10181) --- packages/playwright-core/src/cli/cli.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/playwright-core/src/cli/cli.ts b/packages/playwright-core/src/cli/cli.ts index 913cd82af8..031d6fc053 100755 --- a/packages/playwright-core/src/cli/cli.ts +++ b/packages/playwright-core/src/cli/cli.ts @@ -292,6 +292,7 @@ type Options = { lang?: string; loadStorage?: string; proxyServer?: string; + proxyBypass?: string; saveStorage?: string; saveTrace?: string; timeout: string; @@ -340,6 +341,8 @@ async function launchContext(options: Options, headless: boolean, executablePath launchOptions.proxy = { server: options.proxyServer }; + if (options.proxyBypass) + launchOptions.proxy.bypass = options.proxyBypass; } const browser = await browserType.launch(launchOptions); @@ -576,6 +579,7 @@ function commandWithOpenOptions(command: string, description: string, options: a .option('--load-storage ', 'load context storage state from the file, previously saved with --save-storage') .option('--lang ', 'specify language / locale, for example "en-GB"') .option('--proxy-server ', 'specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"') + .option('--proxy-bypass ', 'comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"') .option('--save-storage ', 'save context storage state at the end, for later use with --load-storage') .option('--save-trace ', 'record a trace for the session and save it to a file') .option('--timezone