Chrome Flags Reference

Chrome command line switches and startup flags for automation, headless mode, and debugging.

--as-browser

What does --as-browser do?

Flag to launch tests in the browser process.

Usage

CLILaunch Chrome with --as-browser using CLI

chrome --as-browser

PuppeteerLaunch Chrome with --as-browser using Puppeteer

const browser = await puppeteer.launch({
  args: ['--as-browser']
});

PlaywrightLaunch Chrome with --as-browser using Playwright

const browser = await chromium.launch({
  args: ['--as-browser']
});

SeleniumLaunch Chrome with --as-browser using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--as-browser')

driver = webdriver.Chrome(options=options)