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.
-
Context isolation on. Every
BrowserWindowsetscontextIsolation: trueandsandbox: true. A test opens each window and fails if either is off. -
No Node in the renderer.
nodeIntegrationstays false. The renderer reaches the main process only through a small, typed API exposed from the preload script withcontextBridge.exposeInMainWorld; exposingipcRendereritself fails the review. -
Signed auto-updates. Releases are code-signed on Windows and signed and notarized on macOS, and
electron-updaterchecks the signature before it installs. Updates roll out in stages. -
Validated IPC. Every
ipcMain.handlechecks who sent the message throughevent.senderFrameand parses its arguments with a schema. The main process never trusts data from a renderer. -
No untrusted content in privileged windows. Windows load only local content under a strict Content Security Policy.
setWindowOpenHandlerdenies by default, navigation away is blocked, andshell.openExternalonly opens allowlisted https URLs. -
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
RunAsNodeoff. -
A responsive main process. The main process does no blocking work; heavy work runs in a utility process.
ipcRenderer.sendSyncand synchronous file I/O in the main process fail the review.