2016-05-17 23:02:54 +00:00
|
|
|
# Supported Chrome Command Line Switches
|
2014-08-15 05:06:52 +00:00
|
|
|
|
2016-04-21 22:39:12 +00:00
|
|
|
> Command line switches supported by Electron.
|
2016-04-21 22:35:29 +00:00
|
|
|
|
|
|
|
You can use [app.commandLine.appendSwitch][append-switch] to append them in
|
2016-04-22 18:42:54 +00:00
|
|
|
your app's main script before the [ready][ready] event of the [app][app] module
|
|
|
|
is emitted:
|
2014-08-15 05:06:52 +00:00
|
|
|
|
|
|
|
```javascript
|
2016-05-10 16:26:38 +00:00
|
|
|
const {app} = require('electron');
|
2014-11-10 19:53:12 +00:00
|
|
|
app.commandLine.appendSwitch('remote-debugging-port', '8315');
|
2014-08-15 05:06:52 +00:00
|
|
|
app.commandLine.appendSwitch('host-rules', 'MAP * 127.0.0.1');
|
|
|
|
|
2016-05-04 17:59:02 +00:00
|
|
|
app.on('ready', () => {
|
2015-06-09 14:59:14 +00:00
|
|
|
// Your code here
|
2014-08-15 05:06:52 +00:00
|
|
|
});
|
|
|
|
```
|
|
|
|
|
2015-06-16 08:13:46 +00:00
|
|
|
## --ignore-connections-limit=`domains`
|
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
Ignore the connections limit for `domains` list separated by `,`.
|
2015-06-16 08:13:46 +00:00
|
|
|
|
2015-01-05 21:40:38 +00:00
|
|
|
## --disable-http-cache
|
|
|
|
|
|
|
|
Disables the disk cache for HTTP requests.
|
|
|
|
|
2016-05-18 01:26:58 +00:00
|
|
|
## --disable-http2
|
|
|
|
|
|
|
|
Disable HTTP/2 and SPDY/3.1 protocols.
|
|
|
|
|
2014-08-15 05:06:52 +00:00
|
|
|
## --remote-debugging-port=`port`
|
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
Enables remote debugging over HTTP on the specified `port`.
|
2014-08-15 05:06:52 +00:00
|
|
|
|
2015-11-13 04:22:08 +00:00
|
|
|
## --js-flags=`flags`
|
|
|
|
|
|
|
|
Specifies the flags passed to JS engine. It has to be passed when starting
|
|
|
|
Electron if you want to enable the `flags` in the main process.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ electron --js-flags="--harmony_proxies --harmony_collections" your-app
|
|
|
|
```
|
|
|
|
|
2014-08-20 03:57:15 +00:00
|
|
|
## --proxy-server=`address:port`
|
|
|
|
|
2015-11-11 14:55:32 +00:00
|
|
|
Use a specified proxy server, which overrides the system setting. This switch
|
|
|
|
only affects requests with HTTP protocol, including HTTPS and WebSocket
|
|
|
|
requests. It is also noteworthy that not all proxy servers support HTTPS and
|
|
|
|
WebSocket requests.
|
2014-08-20 03:57:15 +00:00
|
|
|
|
2015-11-22 21:44:20 +00:00
|
|
|
## --proxy-bypass-list=`hosts`
|
|
|
|
|
|
|
|
Instructs Electron to bypass the proxy server for the given semi-colon-separated
|
|
|
|
list of hosts. This flag has an effect only if used in tandem with
|
|
|
|
`--proxy-server`.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
2015-11-24 10:40:50 +00:00
|
|
|
```javascript
|
2015-12-24 11:22:22 +00:00
|
|
|
app.commandLine.appendSwitch('proxy-bypass-list', '<local>;*.google.com;*foo.com;1.2.3.4:5678')
|
2015-11-24 10:40:50 +00:00
|
|
|
```
|
2015-11-22 21:44:20 +00:00
|
|
|
|
2015-11-24 10:40:50 +00:00
|
|
|
Will use the proxy server for all hosts except for local addresses (`localhost`,
|
|
|
|
`127.0.0.1` etc.), `google.com` subdomains, hosts that contain the suffix
|
|
|
|
`foo.com` and anything at `1.2.3.4:5678`.
|
2015-11-22 21:44:20 +00:00
|
|
|
|
2015-07-10 08:26:21 +00:00
|
|
|
## --proxy-pac-url=`url`
|
|
|
|
|
|
|
|
Uses the PAC script at the specified `url`.
|
|
|
|
|
2014-08-20 03:57:15 +00:00
|
|
|
## --no-proxy-server
|
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
Don't use a proxy server and always make direct connections. Overrides any other
|
2014-08-20 03:57:15 +00:00
|
|
|
proxy server flags that are passed.
|
|
|
|
|
2014-08-15 05:06:52 +00:00
|
|
|
## --host-rules=`rules`
|
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
A comma-separated list of `rules` that control how hostnames are mapped.
|
2014-08-15 05:06:52 +00:00
|
|
|
|
|
|
|
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
|
2015-07-23 16:59:51 +00:00
|
|
|
and host resolver in a direct connection, and the `CONNECT` in an HTTP proxy
|
2014-08-15 05:06:52 +00:00
|
|
|
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.
|
|
|
|
|
2016-05-21 18:08:50 +00:00
|
|
|
## --auth-server-whitelist=`url`
|
|
|
|
|
|
|
|
A comma-separated list of servers for which integrated authentication is enabled.
|
|
|
|
|
|
|
|
For example:
|
|
|
|
|
|
|
|
```
|
|
|
|
--auth-server-whitelist='*example.com, *foobar.com, *baz'
|
|
|
|
```
|
|
|
|
|
|
|
|
then any `url` ending with `example.com`, `foobar.com`, `baz` will be considered
|
|
|
|
for integrated authentication. Without `*` prefix the url has to match exactly.
|
|
|
|
|
|
|
|
## --auth-negotiate-delegate-whitelist=`url`
|
|
|
|
|
|
|
|
A comma-separated list of servers for which delegation of user credentials is required.
|
|
|
|
Without `*` prefix the url has to match exactly.
|
|
|
|
|
2015-01-07 04:52:28 +00:00
|
|
|
## --ignore-certificate-errors
|
|
|
|
|
2015-06-09 01:56:19 +00:00
|
|
|
Ignores certificate related errors.
|
2015-03-25 12:21:56 +00:00
|
|
|
|
2015-06-09 01:56:19 +00:00
|
|
|
## --ppapi-flash-path=`path`
|
2015-05-10 04:55:19 +00:00
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
Sets the `path` of the pepper flash plugin.
|
2015-05-10 04:55:19 +00:00
|
|
|
|
2015-06-09 01:56:19 +00:00
|
|
|
## --ppapi-flash-version=`version`
|
2015-05-10 04:55:19 +00:00
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
Sets the `version` of the pepper flash plugin.
|
2015-05-10 04:55:19 +00:00
|
|
|
|
2015-06-09 01:56:19 +00:00
|
|
|
## --log-net-log=`path`
|
2015-06-05 19:29:28 +00:00
|
|
|
|
2015-07-23 16:59:51 +00:00
|
|
|
Enables net log events to be saved and writes them to `path`.
|
2015-06-05 19:29:28 +00:00
|
|
|
|
2015-09-21 16:43:32 +00:00
|
|
|
## --ssl-version-fallback-min=`version`
|
|
|
|
|
2016-05-10 08:35:12 +00:00
|
|
|
Sets the minimum SSL/TLS version (`tls1`, `tls1.1` or `tls1.2`) that TLS
|
2015-09-21 16:43:32 +00:00
|
|
|
fallback will accept.
|
|
|
|
|
2015-10-19 20:56:01 +00:00
|
|
|
## --cipher-suite-blacklist=`cipher_suites`
|
|
|
|
|
2016-01-07 04:28:20 +00:00
|
|
|
Specifies comma-separated list of SSL cipher suites to disable.
|
|
|
|
|
|
|
|
## --disable-renderer-backgrounding
|
|
|
|
|
|
|
|
Prevents Chromium from lowering the priority of invisible pages' renderer
|
|
|
|
processes.
|
|
|
|
|
|
|
|
This flag is global to all renderer processes, if you only want to disable
|
|
|
|
throttling in one window, you can take the hack of
|
|
|
|
[playing silent audio][play-silent-audio].
|
2015-10-19 20:56:01 +00:00
|
|
|
|
2015-10-03 07:43:26 +00:00
|
|
|
## --enable-logging
|
|
|
|
|
|
|
|
Prints Chromium's logging into console.
|
|
|
|
|
2015-10-20 05:06:41 +00:00
|
|
|
This switch can not be used in `app.commandLine.appendSwitch` since it is parsed
|
|
|
|
earlier than user's app is loaded, but you can set the `ELECTRON_ENABLE_LOGGING`
|
|
|
|
environment variable to achieve the same effect.
|
2015-10-03 07:43:26 +00:00
|
|
|
|
2015-03-25 12:21:56 +00:00
|
|
|
## --v=`log_level`
|
|
|
|
|
2015-03-26 03:27:06 +00:00
|
|
|
Gives the default maximal active V-logging level; 0 is the default. Normally
|
|
|
|
positive values are used for V-logging levels.
|
2015-03-25 12:21:56 +00:00
|
|
|
|
2015-10-03 07:43:26 +00:00
|
|
|
This switch only works when `--enable-logging` is also passed.
|
2015-03-25 12:21:56 +00:00
|
|
|
|
|
|
|
## --vmodule=`pattern`
|
|
|
|
|
2015-03-26 03:27:06 +00:00
|
|
|
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*.*`.
|
2015-03-25 12:21:56 +00:00
|
|
|
|
2015-03-26 03:27:06 +00:00
|
|
|
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
|
2015-07-23 16:59:51 +00:00
|
|
|
logging level for all code in the source files under a `foo/bar` directory.
|
2015-03-25 12:21:56 +00:00
|
|
|
|
2015-10-03 07:43:26 +00:00
|
|
|
This switch only works when `--enable-logging` is also passed.
|
2016-01-07 04:28:20 +00:00
|
|
|
|
|
|
|
[app]: app.md
|
|
|
|
[append-switch]: app.md#appcommandlineappendswitchswitch-value
|
|
|
|
[ready]: app.md#event-ready
|
|
|
|
[play-silent-audio]: https://github.com/atom/atom/pull/9485/files
|