Chrome Flags Reference

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

--focus

What does --focus do?

Activates an existing tab or app window by URL or app id before creating anything new. Syntax: comma-ordered selectors. Bare URLs are exact. Add a trailing * for prefix. app:<app-id> targets PWAs. Example: --focus=https://meet.google.com/*,app:abc123

Usage

CLILaunch Chrome with --focus using CLI

chrome --focus

PuppeteerLaunch Chrome with --focus using Puppeteer

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

PlaywrightLaunch Chrome with --focus using Playwright

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

SeleniumLaunch Chrome with --focus using Selenium

from selenium import webdriver

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

driver = webdriver.Chrome(options=options)