electron_configure_csp
Generate a Content Security Policy for Electron apps, accounting for bundler, framework, and dev-mode. Returns both meta-tag and webRequest implementations.
Instructions
Generate a Content Security Policy for an Electron app. Accounts for the bundler (Vite, webpack), framework (React, Vue, Svelte), and whether dev-mode exceptions are needed. Returns both meta-tag and session.webRequest approaches.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bundler | No | Bundler used (affects script-src for HMR in dev mode). Defaults to 'vite'. | |
| needsInlineStyles | No | Whether inline styles are required (e.g. CSS-in-JS). Defaults to false. | |
| needsEval | No | Whether eval() is needed (some template compilers). Defaults to false. | |
| externalConnections | No | External origins the app connects to, e.g. ['https://api.example.com', 'wss://ws.example.com'] | |
| externalImages | No | External origins for images, e.g. ['https://cdn.example.com'] |