Chrome Flags Reference

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

--use-fake-device-for-media-stream

What does --use-fake-device-for-media-stream do?

Use fake device for Media Stream to replace actual camera and microphone. For the list of allowed parameters, see FakeVideoCaptureDeviceFactory::ParseFakeDevicesConfigFromOptionsString().

Usage

CLILaunch Chrome with --use-fake-device-for-media-stream using CLI

chrome --use-fake-device-for-media-stream

PuppeteerLaunch Chrome with --use-fake-device-for-media-stream using Puppeteer

const browser = await puppeteer.launch({
  args: ['--use-fake-device-for-media-stream']
});

PlaywrightLaunch Chrome with --use-fake-device-for-media-stream using Playwright

const browser = await chromium.launch({
  args: ['--use-fake-device-for-media-stream']
});

SeleniumLaunch Chrome with --use-fake-device-for-media-stream using Selenium

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument('--use-fake-device-for-media-stream')

driver = webdriver.Chrome(options=options)