← Tutti i modelli

Isolamento del contesto attivo, niente Node nel renderer, aggiornamenti automatici firmati.

Constitution — Electron app

Version 1.0.0 · Ratified 2026-11-10

These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.

  1. Context isolation on. Every BrowserWindow sets contextIsolation: true and sandbox: true. A test opens each window and fails if either is off.

  2. No Node in the renderer. nodeIntegration stays false. The renderer reaches the main process only through a small, typed API exposed from the preload script with contextBridge.exposeInMainWorld; exposing ipcRenderer itself fails the review.

  3. Signed auto-updates. Releases are code-signed on Windows and signed and notarized on macOS, and electron-updater checks the signature before it installs. Updates roll out in stages.

  4. Validated IPC. Every ipcMain.handle checks who sent the message through event.senderFrame and parses its arguments with a schema. The main process never trusts data from a renderer.

  5. No untrusted content in privileged windows. Windows load only local content under a strict Content Security Policy. setWindowOpenHandler denies by default, navigation away is blocked, and shell.openExternal only opens allowlisted https URLs.

  6. Electron kept current. The app stays on a supported Electron major version (one of the latest three) and flips the security fuses, such as turning RunAsNode off.

  7. A responsive main process. The main process does no blocking work; heavy work runs in a utility process. ipcRenderer.sendSync and synchronous file I/O in the main process fail the review.