Preload script executed before renderer process content loads.
Sets up IPC context bridges, exposes main process APIs to the renderer, and initializes debugging utilities.
/** * Set up IPC event tracing and debugging utilities. * Allows inspection of IPC messages for development and troubleshooting. * @source */ try { console.log("[Preload] Setting up IPC debugging..."); setupIpcDebugging(); console.log("[Preload] ✅ IPC debugging setup complete"); } catch (error) { console.error("[Preload] ❌ Failed to setup IPC debugging:", error); }
/** * Expose secure context bridges to the renderer process. * Makes main process APIs available via window.electronAPI, window.electronAuth, etc. * This is the security boundary between main and renderer processes. * @source */ try { console.log("[Preload] Exposing contexts..."); exposeContexts(); console.log("[Preload] ✅ All contexts exposed successfully"); } catch (error) { console.error("[Preload] ❌ Failed to expose contexts:", error); }
Description
Preload script executed before renderer process content loads. Sets up IPC context bridges, exposes main process APIs to the renderer, and initializes debugging utilities.
Source