docs: fix formatting in fuses tutorial (#43303)

This commit is contained in:
David Sanders 2024-08-13 12:27:44 -07:00 коммит произвёл GitHub
Родитель d004329f6f
Коммит 62406708cd
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -13,6 +13,7 @@ Fuses are the solution to this problem, at a high level they are "magic bits" in
### `runAsNode` ### `runAsNode`
**Default:** Enabled **Default:** Enabled
**@electron/fuses:** `FuseV1Options.RunAsNode` **@electron/fuses:** `FuseV1Options.RunAsNode`
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios). The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios).
@ -20,6 +21,7 @@ The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variab
### `cookieEncryption` ### `cookieEncryption`
**Default:** Disabled **Default:** Disabled
**@electron/fuses:** `FuseV1Options.EnableCookieEncryption` **@electron/fuses:** `FuseV1Options.EnableCookieEncryption`
The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse. The cookieEncryption fuse toggles whether the cookie store on disk is encrypted using OS level cryptography keys. By default the sqlite database that Chromium uses to store cookies stores the values in plaintext. If you wish to ensure your apps cookies are encrypted in the same way Chrome does then you should enable this fuse. Please note it is a one-way transition, if you enable this fuse existing unencrypted cookies will be encrypted-on-write but if you then disable the fuse again your cookie store will effectively be corrupt and useless. Most apps can safely enable this fuse.
@ -27,6 +29,7 @@ The cookieEncryption fuse toggles whether the cookie store on disk is encrypted
### `nodeOptions` ### `nodeOptions`
**Default:** Enabled **Default:** Enabled
**@electron/fuses:** `FuseV1Options.EnableNodeOptionsEnvironmentVariable` **@electron/fuses:** `FuseV1Options.EnableNodeOptionsEnvironmentVariable`
The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse. The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api/cli.html#node_optionsoptions) and [`NODE_EXTRA_CA_CERTS`](https://github.com/nodejs/node/blob/main/doc/api/cli.md#node_extra_ca_certsfile) environment variables are respected. The `NODE_OPTIONS` environment variable can be used to pass all kinds of custom options to the Node.js runtime and isn't typically used by apps in production. Most apps can safely disable this fuse.
@ -34,6 +37,7 @@ The nodeOptions fuse toggles whether the [`NODE_OPTIONS`](https://nodejs.org/api
### `nodeCliInspect` ### `nodeCliInspect`
**Default:** Enabled **Default:** Enabled
**@electron/fuses:** `FuseV1Options.EnableNodeCliInspectArguments` **@electron/fuses:** `FuseV1Options.EnableNodeCliInspectArguments`
The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse. The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. flags are respected or not. When disabled it also ensures that `SIGUSR1` signal does not initialize the main process inspector. Most apps can safely disable this fuse.
@ -41,6 +45,7 @@ The nodeCliInspect fuse toggles whether the `--inspect`, `--inspect-brk`, etc. f
### `embeddedAsarIntegrityValidation` ### `embeddedAsarIntegrityValidation`
**Default:** Disabled **Default:** Disabled
**@electron/fuses:** `FuseV1Options.EnableEmbeddedAsarIntegrityValidation` **@electron/fuses:** `FuseV1Options.EnableEmbeddedAsarIntegrityValidation`
The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive. The embeddedAsarIntegrityValidation fuse toggles an experimental feature on macOS that validates the content of the `app.asar` file when it is loaded. This feature is designed to have a minimal performance impact but may marginally slow down file reads from inside the `app.asar` archive.
@ -50,6 +55,7 @@ For more information on how to use asar integrity validation please read the [As
### `onlyLoadAppFromAsar` ### `onlyLoadAppFromAsar`
**Default:** Disabled **Default:** Disabled
**@electron/fuses:** `FuseV1Options.OnlyLoadAppFromAsar` **@electron/fuses:** `FuseV1Options.OnlyLoadAppFromAsar`
The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code. The onlyLoadAppFromAsar fuse changes the search system that Electron uses to locate your app code. By default Electron will search in the following order `app.asar` -> `app` -> `default_app.asar`. When this fuse is enabled the search order becomes a single entry `app.asar` thus ensuring that when combined with the `embeddedAsarIntegrityValidation` fuse it is impossible to load non-validated code.
@ -57,6 +63,7 @@ The onlyLoadAppFromAsar fuse changes the search system that Electron uses to loc
### `loadBrowserProcessSpecificV8Snapshot` ### `loadBrowserProcessSpecificV8Snapshot`
**Default:** Disabled **Default:** Disabled
**@electron/fuses:** `FuseV1Options.LoadBrowserProcessSpecificV8Snapshot` **@electron/fuses:** `FuseV1Options.LoadBrowserProcessSpecificV8Snapshot`
The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do. The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is used for the browser process. By default Electron's processes will all use the same V8 snapshot file. When this fuse is enabled the browser process uses the file called `browser_v8_context_snapshot.bin` for its V8 snapshot. The other processes will use the V8 snapshot file that they normally do.
@ -64,6 +71,7 @@ The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is
### `grantFileProtocolExtraPrivileges` ### `grantFileProtocolExtraPrivileges`
**Default:** Enabled **Default:** Enabled
**@electron/fuses:** `FuseV1Options.GrantFileProtocolExtraPrivileges` **@electron/fuses:** `FuseV1Options.GrantFileProtocolExtraPrivileges`
The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](./security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse. The grantFileProtocolExtraPrivileges fuse changes whether pages loaded from the `file://` protocol are given privileges beyond what they would receive in a traditional web browser. This behavior was core to Electron apps in original versions of Electron but is no longer required as apps should be [serving local files from custom protocols](./security.md#18-avoid-usage-of-the-file-protocol-and-prefer-usage-of-custom-protocols) now instead. If you aren't serving pages from `file://` you should disable this fuse.