electron
Electron with security first: main/renderer/preload/IPC, context isolation, sandbox, CSP, navigation control, signing/auto-update. Use for Electron apps; untrusted content never gains privileges.
SKILL.mdskills/frameworks/electron/SKILL.md
GitHubelectron
Two processes, one hard boundary. The renderer is hostile territory; preload is the only bridge, and it is narrow.
Activate when
- Building or changing Electron apps: IPC surface, preload scripts, navigation, permissions, packaging, updates.
Do NOT activate for
- Pure web UI (see frontend/*); Node services (see frameworks/express).
Procedure
- Version: detect Electron release from package.json lockfile; research in https://www.electronjs.org/docs/latest/ for that release (defaults for isolation/sandbox changed across majors). Check https://github.com/electron/electron releases for breaking changes.
- Architecture: main (Node privileges) vs renderer (untrusted) vs preload (minimal typed bridge).
contextIsolation: true,sandbox: true,nodeIntegration: false; never relax for convenience. - IPC: allowlisted channels with schema-validated payloads both directions;
ipcRenderernever exposed raw — expose named functions viacontextBridge;ipcMain.handlevalidates sender frame. - Navigation:
will-navigate/new-window/setWindowOpenHandlerdeny-by-default;webContentspermission handlers deny by default (media, notifications, fullscreen); CSP set; remote content over HTTPS only, and remote content never receives privileged APIs. - Native: modules rebuilt for the pinned Electron/Node ABI; auto-update feed over HTTPS with signature verification; code signing (macOS/Windows) before distribution.
- Secrets/storage: OS keychain via safeStorage for secrets; no tokens in localStorage; clear-session-data on logout.
- Verify: security checklist review per release, navigation/permission abuse tests, packaged-app smoke test with update check, signed installer confirmed.
Failure modes
nodeIntegration: truefor debugging left on; preload exposing entire modules;shell.openExternalon unvalidated URLs; loading remote content with privileges; unsigned auto-updates.
References
- Registry:
../../research/documentation-search/references/framework-registry.yaml(electron).