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

Electron environment variables


May 25, 2021 Electron


Table of contents


Some Electron's behavior is controlled by environment variables because they initialize earlier than the command line and application code.

Examples of POSIX shells:

$ export ELECTRON_ENABLE_LOGGING=true
$ electron

Windows Console:

> set ELECTRON_ENABLE_LOGGING=true
> electron

ELECTRON_RUN_AS_NODE

Similar to .js normal process startup.

ELECTRON_ENABLE_LOGGING

Print Chrome's internal logs to the console.

ELECTRON_LOG_ASAR_READS

When Electron reads the ASAR document and logs the read offset and document path to the system tmpdir . the result file will be provided to the ASAR module to optimize the document organization.

ELECTRON_ENABLE_STACK_DUMPING

When Electron crashes, the print stack logs to the console.

If crashReporter been activated then this environmental variable is effective.

ELECTRON_DEFAULT_ERROR_MODE Windows

When Electron crashes, the windows crash dialog box is displayed.

If crashReporter been activated then this environmental variable is effective.

ELECTRON_NO_ATTACH_CONSOLE Windows

The current console is not available.

ELECTRON_FORCE_WINDOW_MENU_BAR Linux

The global menu bar can no longer be used on Linux.

ELECTRON_HIDE_INTERNAL_MODULES

Turn off old built-in require('ipc')