Chrome Flags Reference

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

--headless

What does --headless do?

Run in headless mode, i.e., without a UI or display server dependencies.

Usage

CLILaunch Chrome with --headless using CLI

chrome --headless

PuppeteerLaunch Chrome with --headless using Puppeteer

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

PlaywrightLaunch Chrome with --headless using Playwright

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

SeleniumLaunch Chrome with --headless using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--headless')

driver = webdriver.Chrome(options=options)