Chrome Flags Reference

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

--file-url-path-alias

What does --file-url-path-alias do?

Define an alias root directory which is replaced with the replacement string in file URLs. The format is "/alias=/replacement", which would turn file:///alias/some/path.html into file:///replacement/some/path.html.

Usage

CLILaunch Chrome with --file-url-path-alias using CLI

chrome --file-url-path-alias

PuppeteerLaunch Chrome with --file-url-path-alias using Puppeteer

const browser = await puppeteer.launch({
  args: ['--file-url-path-alias']
});

PlaywrightLaunch Chrome with --file-url-path-alias using Playwright

const browser = await chromium.launch({
  args: ['--file-url-path-alias']
});

SeleniumLaunch Chrome with --file-url-path-alias using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--file-url-path-alias')

driver = webdriver.Chrome(options=options)