How to pass an argument to electron when using electron-builder?

Viewed 3057

I'm building an application with Electron and packaging with Electron Builder. When running electron, I want to pass this command line argument: --enable-mixed-sandbox.

Is it possible? How?

This:

 app.commandLine.appendSwitch('enable-mixed-sandbox')

wouldn't work due to:

Note that it is not enough to call app.commandLine.appendSwitch('--enable-sandbox'), as electron/node startup code runs after it is possible to make changes to chromium sandbox settings. The switch must be passed to electron on the command-line:

electron --enable-sandbox app.js

It is not possible to have the OS sandbox active only for some renderers, if --enable-sandbox is enabled, normal electron windows cannot be created.

3 Answers
Related