Electron Fuses

    For a subset of Electron functionality it makes sense to disable certain features for an entire application. For example, 99% of apps don’t make use of , these applications want to be able to ship a binary that is incapable of using that feature. We also don’t want Electron consumers building Electron from source as that is both a massive technical challenge and has a high cost of both time and money.

    How do I flip the fuses?

    We’ve made a handy module @electron/fuses to make flipping these fuses easy. Check out the README of that module for more details on usage and potential error cases.

    复杂方式

    Quick Glossary

    • Fuse Wire: A sequence of bytes in the Electron binary used to control the fuses
    • Sentinel: A static known sequence of bytes you can use to locate the fuse wire
    • Fuse Schema: The format / allowed values for the fuse wire

    Somewhere in the Electron binary there will be a sequence of bytes that look like this:

    • fuse_version is a single byte whose unsigned integer value represents the version of the fuse schema
    • is a single byte whose unsigned integer value represents the number of fuses in the following fuse wire
    • fuse_wire is a sequence of N bytes, each byte represents a single fuse and its state.
      • “0” (0x30) indicates the fuse is disabled
      • “r” (0x72) indicates the fuse has been removed and changing the byte to either 1 or 0 will have no effect.

    您可以在 查看当前schema。