Chrome Flags Reference

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

--trace-to-file

What does --trace-to-file do?

Sends trace events from these categories to a file. --trace-to-file on its own sends to default categories.

Usage

CLILaunch Chrome with --trace-to-file using CLI

chrome --trace-to-file

PuppeteerLaunch Chrome with --trace-to-file using Puppeteer

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

PlaywrightLaunch Chrome with --trace-to-file using Playwright

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

SeleniumLaunch Chrome with --trace-to-file using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--trace-to-file')

driver = webdriver.Chrome(options=options)