electron - 使用 Electron 构建器时如何将参数传递给 Electron ?

标签 electron electron-builder electron-packager

我正在使用 Electron 构建一个应用程序,并使用 Electron Builder 进行打包。当运行 Electron 时,我想通过这个command line argument: --enable-mixed-sandbox .

这可能吗?怎么办?

这个:

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

不行 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.

最佳答案

enable-mixed-sandbox 不是有效的 Electron 命令行标志。请参阅here对于 Electron 的所有可用命令行标志。

关于electron - 使用 Electron 构建器时如何将参数传递给 Electron ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45288492/

相关文章:

javascript - 单击按钮但不打开窗口或链接 Electron

electron - 在 Mac 中使用 Electron 定义文件关联

reactjs - 为什么 Electron 使用以前的更改而不是最新的更改来构建 React 应用程序?

electron - 如何在electronJS中为不同的文件扩展名类型设置不同的图标?

homebrew - 与电子打包器一起分发 Homebrew 依赖项

electron - 在.asar外部存储CSS图形

typescript - 如何在 Electron 中使用 typescript 而无需编译?

electron - 如何使用 Electron 构建器在 ubuntu 中为 windows 构建 Electron 应用程序

Electron builder - 未设置 GitHub 个人访问 token ,既不以编程方式,也不使用 env "GH_TOKEN"

javascript - electron-packager 不设置图标