Process Model Ipc
Use when wiring Electron's main↔renderer↔preload split or any IPC — ipcMain.handle/ipcRenderer.invoke, ipcRenderer.send/ipcMain.on, webContents.send, MessagePortMain/MessageChannelMain, contextBridge.exposeInMainWorld — or debugging "window.electronAPI is undefined", "ipcRenderer is not defined", contextIsolation/sandbox errors, "An object could not be cloned", senderFrame null, ou "process model…
Crash Diagnostics
Use when an Electron app crashes, the renderer/GPU/utility process dies, or you need minidumps and traces — `crashReporter.start`, `render-process-gone`/`child-process-gone`, `app.getAppMetrics()`, `contentTracing`, `app.getPath('crashDumps')`, Crashpad, `getLastCrashReport`. Symptoms: \"renderer process gone\", white screen on crash, oom/abnormal-exit, \"Aw, Snap\", process killed, fenêtre qui p…
Performance
Use when an Electron app is slow or janky — slow startup/cold start, high RAM, frozen window, blocked main process or UI thread (démarrage lent, fenêtre figée, app qui rame, jank). Covers the performance checklist, lazy `require()`, profiling with `--cpu-prof`/`--heap-prof`, offloading CPU work via `utilityProcess.fork`/worker threads, `requestIdleCallback`/Web Workers, bundling, `Menu.setApplica…
Windows
Use when creating or managing Electron windows — new BrowserWindow, loadFile/loadURL, the ready-to-show + show:false flicker-free pattern, frameless/transparent windows, titleBarStyle/titleBarOverlay, parent/modal windows, win.webContents, or BaseWindow + WebContentsView composition (multiple views in one window, contentView.addChildView). Also BrowserView (deprecated → WebContentsView) and the b…
Security
Use when hardening an Electron app or reviewing renderer/IPC security — contextIsolation, nodeIntegration, sandbox, webSecurity, Content-Security-Policy (CSP), onHeadersReceived, setWindowOpenHandler, will-navigate, validate IPC sender (senderFrame), shell.openExternal, setPermissionRequestHandler, @electron/fuses (RunAsNode, OnlyLoadAppFromAsar), asar integrity, XSS jumping out of the renderer,…
Distribution
Use when packaging, signing, or shipping an Electron app — Electron Forge (forge.config.js, makers, publishers, make/package/publish) vs electron-builder, macOS signing (Developer ID, hardened runtime, com.apple.security.cs.allow-jit, @electron/notarize, stapling, sign→notarize→staple), Windows Authenticode / Azure Trusted Signing, Mac App Store / MAS, auto-update (autoUpdater, Squirrel, update-e…
Webcontents Navigation
Use when controlling page content or navigation in Electron — webContents.loadURL/loadFile, executeJavaScript, webContents.send, setWindowOpenHandler, printToPDF, capturePage, setZoomFactor, openDevTools; events will-navigate, will-frame-navigate, will-redirect, did-navigate, did-finish-load, did-fail-load; webFrame vs webFrameMain (event.senderFrame), window.open/BrowserWindowProxy, <webview> vs…
System Integration
Use when touching Electron main-process OS modules — shell (openExternal, openPath, trashItem), clipboard, globalShortcut (register hotkeys), powerMonitor (suspend/resume/lock-screen, getSystemIdleState), powerSaveBlocker (prevent-display-sleep), screen (getPrimaryDisplay, getCursorScreenPoint, scaleFactor), systemPreferences (getAccentColor, getMediaAccessStatus), desktopCapturer (getDisplayMedi…
Networking Protocol
Use when making HTTP requests from the main process or serving local files securely — net.fetch/net.request vs Node http, ClientRequest/IncomingMessage, system proxy + NTLM/Kerberos/PAC auth, netLog capture, custom schemes via protocol.registerSchemesAsPrivileged + protocol.handle('app', …) replacing file://, and session (cookies, setProxy, webRequest, setPermissionRequestHandler, setCertificateV…
Testing Debugging
Use when testing or debugging an Electron app — Playwright `_electron.launch`/`firstWindow`, WebdriverIO, Selenium `electron-chromedriver`, headless CI with no display (Xvfb, `xvfb-run`, `xvfb-maybe`), main-process breakpoints via `--inspect`/`--inspect-brk` + `chrome://inspect` or VS Code `launch.json`, renderer DevTools, `--remote-debugging-port`, `session.loadExtension`, `electron --interactiv…
Getting Started
Use when starting a new Electron app or learning Electron from scratch — débuter avec Electron, créer/scaffolder une app desktop, "how do I start an Electron app", set up package.json `main`, `app.whenReady()`, create a `BrowserWindow`, `loadFile('index.html')`, wire a `preload.js`, run with `electron .` or `npm start`, understand main vs renderer vs preload, fix "app is not ready" / blank window…
Native Ui
Use when building native desktop UI in Electron — application/context menu, system tray, native dialogs (open/save file, message box, error box), desktop notifications, dark mode, macOS Touch Bar. Covers Menu.buildFromTemplate, Menu.setApplicationMenu, MenuItem roles/accelerators, Tray, dialog.showOpenDialog/showMessageBox/showErrorBox, Notification, nativeImage template images, nativeTheme (shou…
Native Node Modules
Use when shipping native `.node` addons in Electron breaks — `compiled against a different Node.js version using NODE_MODULE_VERSION`, `ERR_DLOPEN_FAILED`, "Module did not self-register", a native module (better-sqlite3, sharp, serialport, node-pty, keytar, bcrypt) that works in dev but crashes packaged, `process.versions.modules` mismatch, prebuild-install shipping a Node-ABI binary, or asar iss…
App Lifecycle
Use when wiring an Electron app lifecycle — app.whenReady(), the window-all-closed/before-quit/activate/second-instance events, single-instance lock (app.requestSingleInstanceLock), standard paths (app.getPath userData/appData/logs), launch-at-login (setLoginItemSettings), Windows Jump List userTasks, app.getAppMetrics, or reading process.versions.electron, process.type, process.resourcesPath, pr…