Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

The Chrome command line switch supported by Electron


May 25, 2021 Electron


Table of contents


This page lists the command line switches supported by Chrome and Electron. You can also use app.commandLine.appendSwitch to add them to your app's main script before the app module's ready event is issued:

const app = require('electron').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

Set the client's certificate file path .

--ignore-connections-limit= domains

Ignore connection , with domains lists.

--disable-http-cache

Disk caching is prohibited when requesting HTTP.

--remote-debugging-port= port

Turn on remote 端口 via HTTP on the specified port.

--js-flags= flags

Specify the engine to transition to the JS engine.

When You start Electron, if you want to activate flags in the flags it will be converted.

$ electron --js-flags="--harmony_proxies --harmony_collections" your-app

--proxy-server= address:port

With a specific proxy server, it will take precedence over the system settings. T his switch is only valid when using the HTTP protocol and contains HTTPS and WebSocket requests. It is important to note that not all proxy servers support HTTPS and WebSocket requests.

--proxy-bypass-list= hosts

Let Electron use the proxy server for the semi-colon-separated hosts list provided by (se: bypass). This switch is only valid --proxy-server

For example:

app.commandLine.appendSwitch('proxy-bypass-list', '<local>;*.google.com;*foo.com;1.2.3.4:5678')

A proxy server will be used for all hosts except the local localhost , 127.0.0.1 etc.), google.com sub-domains, foo.com and all similar 1.2.3.4:5678

--proxy-pac-url= url

Use the url on the specified url.

--no-proxy-server

Do not use proxy services and always use direct connections. Ignore all reasonable agent flags.

--host-rules= rules

A comma-separated rule controls how host names are mapped.

For example:

  • MAP * 127.0.0.1 host names to map to 127.0.0.1
  • MAP *.google.com proxy all google.com sub-domains to use "proxy".
  • MAP test.com [::1]:77 "test.com" to use IPv6 loopback addresses. Port 77. is also enforced.
  • MAP * baz, EXCLUDE www.google.com remapped to "baz", except "www.google.com".

These maps apply to terminal network requests (TCP connections and host resolution in a direct connection, CONNECT proxy connections, and terminal host SOCKS SOCKS proxy connections).

--host-resolver-rules= rules

Similar --host-rules but rules suitable for host resolution.

--ignore-certificate-errors

Ignore certificate-related errors.

--ppapi-flash-path= path

Set the path path for the Pepper Flash path .

--ppapi-flash-version= version

Set the Pepper Flash plug-in version number.

--log-net-log= path

Enable blog events to be read to path .

--ssl-version-fallback-min= version

Set the most simplified SSL/TLS version number ("tls1", "tls1.1" or "tls1.2"), and TLS accepts fallback.

--cipher-suite-blacklist= cipher_suites

Specifies comma-separated SSL crypt suite list effect.

--disable-renderer-backgrounding

Prevent Chromium from lowering the priority of hidden rendering processes.

This flag is globally valid for all rendering processes, and if you only want to disable it in one window, you can use the hack method playing silent audio .

--enable-logging

Print Chromium information output to the console.

This switch will work if app.commandLine.appendSwitch is resolved before the ELECTRON_ENABLE_LOGGING environment variables to achieve the same effect.

--v= log_level

Set the default maximum active V-logging standard; The default is 0. Usually the V-logging standard value is positive.

This switch is only --enable-logging is on.

--vmodule= pattern

Giving each module the largest V-logging levels to override --v gives .E.g. my_module=2,foo*=3 my_module.* in the code of all source files my_module. foo*.*

Any mode that contains forward slash or backward will be tested to block the entire path name and is not only an E.g module. */foo/bar/*=2 level in all source file codes under foo/bar will be changed .

This switch is only --enable-logging is on.