Chrome Flags Reference

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

--disable-legacy-window

What does --disable-legacy-window do?

Disable the Legacy Window which corresponds to the size of the WebContents.

Usage

CLILaunch Chrome with --disable-legacy-window using CLI

chrome --disable-legacy-window

PuppeteerLaunch Chrome with --disable-legacy-window using Puppeteer

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

PlaywrightLaunch Chrome with --disable-legacy-window using Playwright

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

SeleniumLaunch Chrome with --disable-legacy-window using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--disable-legacy-window')

driver = webdriver.Chrome(options=options)

Build Conditions

LOAD_WEBUI_FROM_DISKANDROIDWIN