electron-dev

Define secure Electron IPC handlers and preload bridges for main and renderer processes.

793|52|Updated Nov 22, 2025
One-click install
npx skills add https://github.com/corvo007/MioSub --skill electron-dev-corvo007
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: electron-dev
Source: https://github.com/corvo007/MioSub/tree/main/.claude/skills/electron-dev
Command: npx skills add https://github.com/corvo007/MioSub --skill electron-dev-corvo007

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Establish secure and consistent Electron main process development patterns for Gemini-Subtitle-Pro, focusing on IPC handlers, preload scripts, native integrations, and cross-process communication to reduce security risks and inconsistencies.

Core Features & Use Cases

  • Secure BrowserWindow configurations (nodeIntegration: false, contextIsolation: true, sandbox: true) and strict IPC contracts to prevent renderer access to Node.js APIs.
  • Reusable IPC patterns for main-to-renderer and renderer-to-main communication, including preload bridges and structured error handling.
  • Use Case: When adding a new desktop feature, follow the guidelines to implement a safe IPC channel and a minimal API surface exposed to the renderer.

Quick Start

Follow the guidelines to implement a new IPC channel with a preload bridge and a secure main process.

Frequently Asked Questions about electron-dev

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up secure IPC communication in an Electron app?

Secure Electron IPC requires configuring BrowserWindow with nodeIntegration disabled, contextIsolation and sandbox enabled, and exposing a minimal API surface to the renderer via a preload bridge to prevent direct Node.js access.

Why does my Electron preload script expose too many Node.js APIs to the renderer?

Your preload script likely lacks contextIsolation or exposes excessive APIs. Secure patterns enforce a minimal API surface using contextBridge, preventing the renderer from directly accessing Node.js APIs and reducing security risks.

What is the best way to structure main-to-renderer IPC in Electron desktop apps?

The best way to structure main-to-renderer IPC is using reusable patterns with structured error handling and a documented preload bridge, ensuring a secure, consistent cross-process communication contract.

How do I add a new IPC channel safely in Electron without breaking security?

To add a new IPC channel safely, follow secure development guidelines to implement the channel in the main process, create a minimal preload bridge, and expose only the necessary API surface to the renderer.

Do I need contextIsolation and sandbox enabled for Electron IPC handlers?

Yes, enabling contextIsolation and sandbox is required for secure Electron IPC. These configurations prevent the renderer from accessing Node.js APIs directly, enforcing strict security contracts across processes.

What are the limitations of exposing native integrations through Electron IPC?

Limitations include the risk of security breaches if nodeIntegration is enabled or if the preload bridge exposes too large an API surface, making strict IPC contracts and minimal renderer access necessary precautions.