Use strict @electron/fuses
This commit is contained in:
parent
a52530262f
commit
bd6ee4b16d
5 changed files with 27 additions and 12 deletions
|
@ -4,9 +4,23 @@
|
|||
|
||||
const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses');
|
||||
|
||||
const IS_RELEASE_BUILD = process.argv.some(argv => argv === '--release');
|
||||
|
||||
flipFuses(require('electron'), {
|
||||
version: FuseVersion.V1,
|
||||
[FuseV1Options.RunAsNode]: false, // Disables ELECTRON_RUN_AS_NODE
|
||||
// Disables ELECTRON_RUN_AS_NODE
|
||||
[FuseV1Options.RunAsNode]: false,
|
||||
// Enables cookie encryption
|
||||
[FuseV1Options.EnableCookieEncryption]: true,
|
||||
// Disables the NODE_OPTIONS environment variable
|
||||
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: !IS_RELEASE_BUILD,
|
||||
// Disables the --inspect and --inspect-brk family of CLI options
|
||||
[FuseV1Options.EnableNodeCliInspectArguments]: !IS_RELEASE_BUILD,
|
||||
// Enables validation of the app.asar archive on macOS
|
||||
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
||||
// Enforces that Electron will only load your app from "app.asar" instead of
|
||||
// it's normall search paths
|
||||
[FuseV1Options.OnlyLoadAppFromAsar]: IS_RELEASE_BUILD,
|
||||
}).catch(error => {
|
||||
console.error(error.stack);
|
||||
process.exit(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue