Secure About window with contextBridge preload instead of nodeIntegration#14
Conversation
…ndow Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR hardens the Electron “About” window by removing renderer Node.js access (nodeIntegration) and switching to a contextBridge-based preload API, aligning it with the existing secure approach used by the Release Notes window.
Changes:
- Updates the About window
BrowserWindowconfig tonodeIntegration: false,contextIsolation: true, and adds anabout-preload.jspreload. - Adds
about-preload.jsto expose a minimalwindow.aboutAPIsurface (version, i18n lookup, progress listener). - Refactors
About.jsandabout.htmlto removerequire()usage in the renderer and load scripts via<script src>.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/sites/about.html | Switches renderer bootstrapping from inline require() to static script tags. |
| app/js/about-preload.js | New preload bridge exposing version/i18n/progress via contextBridge. |
| app/js/MenuTemplate.js | Secures About window webPreferences and wires in the new preload. |
| app/js/About.js | Migrates renderer code to use window.aboutAPI instead of Node/Electron requires. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot please fix findings and solve merge conflict |
…stener cleanup Agent-Logs-Url: https://github.com/Samuel3/LetterCreator/sessions/8d47fbaa-3b3d-465a-b84b-ac1ba49449c7 Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Samuel3/LetterCreator/sessions/8d47fbaa-3b3d-465a-b84b-ac1ba49449c7 Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
Done in commit |
|
@copilot please fix merge conflict |
…kage-lock.json conflicts Agent-Logs-Url: https://github.com/Samuel3/LetterCreator/sessions/e4012f10-97cd-47f1-aef5-c14bf1fc407f Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
Resolved in commit |
|
@copilot please fix merge conflict in app/js/about-preload.js |
Co-authored-by: Samuel3 <15921086+Samuel3@users.noreply.github.com>
Resolved in commit |
The About window was created with
nodeIntegration: trueandcontextIsolation: false, weakening renderer isolation. This replaces it with a secure preload bridge following the same pattern already used by the Release Notes window.Changes
MenuTemplate.js: SetnodeIntegration: false,contextIsolation: true, and wire inabout-preload.jsabout-preload.js(new): Exposes version, i18n, and IPC progress listener viacontextBridge; locale is whitelisted (en,de) before use in file path to prevent path traversalAbout.js: Replace allrequire('electron'),require('../js/i18n'), andrequire('../package.json')withwindow.aboutAPI.*about.html: Replace inlinerequire()script blocks with regular<script src>tags💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.