Chrome Flags Reference

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

--window-size

What does --window-size do?

Specify the initial window size: --window-size=w,h

Usage

CLILaunch Chrome with --window-size using CLI

chrome --window-size

PuppeteerLaunch Chrome with --window-size using Puppeteer

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

PlaywrightLaunch Chrome with --window-size using Playwright

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

SeleniumLaunch Chrome with --window-size using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--window-size')

driver = webdriver.Chrome(options=options)