Use strict @electron/fuses

This commit is contained in:
Fedor Indutny 2021-11-23 23:00:44 +01:00 committed by GitHub
parent a52530262f
commit bd6ee4b16d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 12 deletions

View file

@ -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);