From 2caf08059e23b3a7a2af8d3fe1ef5ebfe3cdfbb9 Mon Sep 17 00:00:00 2001 From: David Sanders Date: Mon, 24 Jul 2023 03:33:26 -0700 Subject: [PATCH] docs: update @electron/fuses code examples (#39175) --- docs/tutorial/asar-integrity.md | 4 +++- docs/tutorial/fuses.md | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/tutorial/asar-integrity.md b/docs/tutorial/asar-integrity.md index 2bbf3ec840527..7558890f9303f 100644 --- a/docs/tutorial/asar-integrity.md +++ b/docs/tutorial/asar-integrity.md @@ -41,7 +41,9 @@ Valid `algorithm` values are currently `SHA256` only. The `hash` is a hash of t ASAR integrity checking is currently disabled by default and can be enabled by toggling a fuse. See [Electron Fuses](fuses.md) for more information on what Electron Fuses are and how they work. When enabling this fuse you typically also want to enable the `onlyLoadAppFromAsar` fuse otherwise the validity checking can be bypassed via the Electron app code search path. ```js @ts-nocheck -require('@electron/fuses').flipFuses( +const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses') + +flipFuses( // E.g. /a/b/Foo.app pathToPackagedApp, { diff --git a/docs/tutorial/fuses.md b/docs/tutorial/fuses.md index ed39e7b2674d4..ea5b8a3428d17 100644 --- a/docs/tutorial/fuses.md +++ b/docs/tutorial/fuses.md @@ -68,7 +68,9 @@ The loadBrowserProcessSpecificV8Snapshot fuse changes which V8 snapshot file is We've made a handy module, [`@electron/fuses`](https://npmjs.com/package/@electron/fuses), to make flipping these fuses easy. Check out the README of that module for more details on usage and potential error cases. ```js @ts-nocheck -require('@electron/fuses').flipFuses( +const { flipFuses, FuseVersion, FuseV1Options } = require('@electron/fuses') + +flipFuses( // Path to electron require('electron'), // Fuses to flip @@ -82,7 +84,7 @@ require('@electron/fuses').flipFuses( You can validate the fuses have been flipped or check the fuse status of an arbitrary Electron app using the fuses CLI. ```bash - npx @electron/fuses read --app /Applications/Foo.app +npx @electron/fuses read --app /Applications/Foo.app ``` ### The hard way