Chrome Flags Reference

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

--allow-file-access-from-files

What does --allow-file-access-from-files do?

By default, file:// URIs cannot read other file:// URIs. This is an override for developers who need the old behavior for testing.

Usage

CLILaunch Chrome with --allow-file-access-from-files using CLI

chrome --allow-file-access-from-files

PuppeteerLaunch Chrome with --allow-file-access-from-files using Puppeteer

const browser = await puppeteer.launch({
  args: ['--allow-file-access-from-files']
});

PlaywrightLaunch Chrome with --allow-file-access-from-files using Playwright

const browser = await chromium.launch({
  args: ['--allow-file-access-from-files']
});

SeleniumLaunch Chrome with --allow-file-access-from-files using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--allow-file-access-from-files')

driver = webdriver.Chrome(options=options)