electron/docs/api/chrome-command-line-switches.md
Jeffrey Morgan d9ee8519e9 Correct error in chrome-command-line-switches.md
Replace “to” with “in” to correct the error identified in
`chrome-command-line-switches.md` by @OlsonDev.
2015-07-23 20:45:08 +01:00

3.3 KiB

Supported Chrome command line switches

This page lists the command line switches used by the Chrome browser that are also supported by Electron. You can use app.commandLine.appendSwitch to append them in your app's main script before the ready event of app module is emitted:

var app = require('app');
app.commandLine.appendSwitch('remote-debugging-port', '8315');
app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');

app.on('ready', function() {
  // Your code here
});

--client-certificate=path

Sets the path of client certificate file.

--ignore-connections-limit=domains

Ignore the connections limit for domains list separated by ,.

--disable-http-cache

Disables the disk cache for HTTP requests.

--remote-debugging-port=port

Enables remote debugging over HTTP on the specified port.

--proxy-server=address:port

Use a specified proxy server, which overrides the system setting. This switch only affects HTTP and HTTPS requests.

--proxy-pac-url=url

Uses the PAC script at the specified url.

--no-proxy-server

Don't use a proxy server and always make direct connections. Overrides any other proxy server flags that are passed.

--host-rules=rules

A comma-separated list of rules that control how hostnames are mapped.

For example:

  • MAP * 127.0.0.1 Forces all hostnames to be mapped to 127.0.0.1
  • MAP *.google.com proxy Forces all google.com subdomains to be resolved to "proxy".
  • MAP test.com [::1]:77 Forces "test.com" to resolve to IPv6 loopback. Will also force the port of the resulting socket address to be 77.
  • MAP * baz, EXCLUDE www.google.com Remaps everything to "baz", except for "www.google.com".

These mappings apply to the endpoint host in a net request (the TCP connect and host resolver in a direct connection, and the CONNECT in an HTTP proxy connection, and the endpoint host in a SOCKS proxy connection).

--host-resolver-rules=rules

Like --host-rules but these rules only apply to the host resolver.

--ignore-certificate-errors

Ignores certificate related errors.

--ppapi-flash-path=path

Sets the path of the pepper flash plugin.

--ppapi-flash-version=version

Sets the version of the pepper flash plugin.

--log-net-log=path

Enables net log events to be saved and writes them to path.

--v=log_level

Gives the default maximal active V-logging level; 0 is the default. Normally positive values are used for V-logging levels.

Passing --v=-1 will disable logging.

--vmodule=pattern

Gives the per-module maximal V-logging levels to override the value given by --v. E.g. my_module=2,foo*=3 would change the logging level for all code in source files my_module.* and foo*.*.

Any pattern containing a forward or backward slash will be tested against the whole pathname and not just the module. E.g. */foo/bar/*=2 would change the logging level for all code in the source files under a foo/bar directory.

To disable all chromium related logs and only enable your application logs you can do:

app.commandLine.appendSwitch('v', -1);
app.commandLine.appendSwitch('vmodule', 'console=0');