Chromium Command Line Switches: The Ultimate Guide for Developers and Power Users
Want to fine-tune your Chromium browser for specific tasks, debugging, or just to see what's under the hood? Chromium command line switches are your secret weapon! This guide reveals a comprehensive list of these switches (also applicable to Chrome), explaining their functions and how they can enhance your browsing experience.
What are Chromium Command Line Switches?
Chromium command line switches are special instructions you can give the Chromium browser when you launch it. Think of them as hidden settings that unlock specific functionalities or modify default behaviors. They can be incredibly useful for developers, testers, and anyone who wants more control over their browser.
Why Use Command Line Switches?
- Debugging: Inspect and analyze browser behavior for troubleshooting.
- Testing: Simulate different environments and scenarios for web development.
- Customization: Tailor the browser's functionality to your specific needs.
- Experimentation: Explore advanced features and internal settings.
How to Use Chromium Command Line Switches
- Close Chromium: Ensure all instances of Chromium are closed.
- Open Command Prompt/Terminal:
- Windows: Press
Win + R
, typecmd
, and press Enter. - macOS: Open "Terminal" from
/Applications/Utilities
. - Linux: Open your preferred terminal application.
- Windows: Press
- Navigate to Chromium's Executable: Use the
cd
command to navigate to the directory where Chromium is installed (e.g.,cd "C:\Program Files\Google\Chrome\Application"
on Windows). - Launch Chromium with Switches: Type
chrome.exe
(or the appropriate executable name for your OS) followed by the desired switches. For example:chrome.exe --disable-web-security --user-data-dir=./test-profile
Important: Switches are case-sensitive and must be preceded by two hyphens (--
).
Essential Chromium Command Line Switches Explained
Below is a breakdown of some key Chromium command line switches, grouped for clarity:
GPU & Rendering
These switches control how Chromium utilizes your graphics card and renders web pages:
--3d-display-mode
: Configures the display mode for 3D content. Useful for testing specific rendering setups.
Security & Permissions
Exercise caution when using these, as they can impact your browser's security.
--allow-cross-origin-auth-prompt
: Enables third-party content to prompt for HTTP basic authentication.--allow-file-access-from-files
: Allows file:// URIs to read other file:// URIs, useful for local web development but reduces security.--allow-http-screen-capture
: Permits non-secure origins to use screen capture API.
Testing & Development
These are particularly helpful for web developers and testers:
--accept-empty-variations-seed-signature
: Accepts an empty signature when loading a variations seed, convenient for testing.--allow-command-line-plugins
: Enables loading plugins from the command line for testing purposes.--allow-external-pages
: Allows access to external pages during web tests, facilitating integration testing.--allow-insecure-localhost
: Ignores TLS/SSL errors onlocalhost
, streamlining local development.
Language & Region
--accept-lang
: Specifies the Accept-Language header sent to servers, affecting the displayed language.
Memory Management
--aggressive-cache-discard
: Configures a lower threshold for aggressive cache discarding
Comprehensive List of Chromium Command Line Switches
(Abridged for Brevity)
Switch | Explanation |
---|---|
--[1] |
No description |
--0 |
No description |
--1 |
No description |
--10000 |
No description |
--100000 |
No description |
--1000000 |
No description |
--2 |
No description |
--3d-display-mode |
No description |
--4 |
No description |
--50000 |
No description |
--500000 |
No description |
--5000000 |
No description |
--7 |
No description |
--? |
No description |
--accept-empty-variations-seed-signature |
Accept an empty signature when loading a variations seed. This is for testing purposes. |
--accept-lang |
Specifies Accept-Language to send to servers and expose to JavaScript via the navigator.language DOM property. language[-country] where language is the 2 letter code from ISO-639. |
--accept-resource-provider |
Flag indicating that a resource provider must be set up to provide cast receiver with resources. Apps cannot start until provided resources. This flag implies --alsa-check-close-timeout=0. |
--adaboost |
No description |
--add-gpu-appcontainer-caps |
Add additional capabilities to the AppContainer sandbox on the GPU process. |
--add-xr-appcontainer-caps |
Add additional capabilities to the AppContainer sandbox used for XR compositing. |
--additional-private-state-token-key-commitments |
Manually sets additional Private State Tokens key commitments in the network service to the given value |
--aggressive-cache-discard |
No description |
--all |
No description |
--all-renderers |
No description |
--allarticles |
No description |
--allow-command-line-plugins |
Allows plugins to be loaded in the command line for testing. |
--allow-cross-origin-auth-prompt |
Allows third-party content included on a page to prompt for a HTTP basic auth username/password pair. |
--allow-empty-passwords-in-tests |
TODO(b/299642185): Remove this flag by the end of 2023. ChromeOS does not support empty passwords for users, but some legacy test setups might use empty password for users. |
--allow-external-pages |
Allow access to external pages during web tests. |
--allow-failed-policy-fetch-for-test |
If this flag is passed, failed policy fetches will not cause profile initialization to fail. |
--allow-file-access-from-files |
By default, file:// URIs cannot read other file:// URIs. This is an override for developers who need the old behavior for testing. |
--allow-future-manifest-version |
No description |
--allow-http-background-page |
No description |
--allow-http-screen-capture |
Allow non-secure origins to use the screen capture API and the desktopCapture extension API. |
--allow-insecure-localhost |
Enables TLS/SSL errors on localhost to be ignored (no interstitial, no blocking of requests). |
--allow-legacy-extension-manifests |
No description |
--allow-loopback-in-peer-connection |
Allows loopback interface to be added in network list for peer connection. |
--allow-nacl-crxfs-api |
Specifies comma-separated list of extension ids or hosts to grant access to CRX file system APIs. |
--allow-nacl-file-handle-api |
Specifies comma-separated list of extension ids or hosts to grant access to file handle APIs. |
--allow-nacl-socket-api |
Specifies comma-separated list of extension ids or hosts to grant access to TCP/UDP socket APIs. |
--allow-os-install |
When this flag is set, the OS installation UI can be accessed. This allows the user to install from USB to disk. |
--allow-pre-commit-input |
Allows processing of input before a frame has been committed. TODO(crbug.com/987626): Used by headless. Look for a way not involving a command line switch. |
--allow-ra-in-dev-mode |
Allows remote attestation (RA) in dev mode for testing purpose. |
--allow-running-insecure-content |
No description |
(Note: The table is abridged; refer to the Chromium source code for the complete list.)
Cautions and Best Practices
- Security Risks: Some switches can disable security features, making your browser vulnerable. Use them with caution, especially when browsing the web normally.
- Stability Issues: Incorrectly used switches can lead to browser instability or crashes.
- Profile Isolation: Use the
--user-data-dir
switch to create a separate profile for testing with command-line switches, preventing conflicts with your regular browsing data. - Experiment Responsibly: Always understand the potential impact of a switch before using it.
Conclusion
Chromium command line switches provide a powerful way to control and customize your browsing experience. By understanding and using these switches effectively, you can enhance your productivity, streamline your development workflow, and explore the inner workings of the Chromium browser. Remember to exercise caution and experiment responsibly!