Repository navigation
fix: avoid internal link from all places - #9660
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
App Markdown renderer and integrations packages/bruno-app/src/utils/markdown/openLinksExternally.js, packages/bruno-app/src/components/AiChatSidebar/utils.js, packages/bruno-app/src/components/RequestPane/QueryEditor/* |
A shared MarkdownIt plugin adds target="_blank" and rel="noopener noreferrer" to links. The AI chat sidebar and QueryEditor descriptions register the plugin. Tests cover HTTPS links and javascript: links. |
GraphQL docs Markdown renderer and tests packages/bruno-graphql-docs/src/components/DocExplorer/MarkdownContent.tsx, packages/bruno-graphql-docs/src/components/DocExplorer/MarkdownContent.test.tsx, packages/bruno-graphql-docs/jest.config.js, packages/bruno-graphql-docs/package.json |
The renderer adds link attributes and uses the prior renderer or a fallback. Jest configuration, scripts, development dependencies, and tests support the renderer and cover HTTPS, javascript:, and file: links. |
Electron URL and IPC Trust
| Layer / File(s) | Summary |
|---|---|
App URL validation and IPC sender checks packages/bruno-electron/src/utils/trusted-url.js, packages/bruno-electron/src/utils/trusted-url.spec.js |
Utilities resolve and compare app URLs, check IPC sender frames, and wrap IPC registrations. Tests cover accepted and rejected URLs, senders, and IPC calls. |
Main-process navigation and window settings packages/bruno-electron/src/index.js, packages/bruno-electron/src/preload.js, packages/bruno-electron/src/app/menu-template.js |
The main process uses the app URL, restricts navigation and IPC, and configures webviews and windows. The preload restricts openExternal to HTTP, HTTPS, and mailto schemes. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant Renderer
participant ipcMain
participant restrictIpcToAppFrames
participant isTrustedSender
participant RegisteredCallback
Renderer->>ipcMain: Send or invoke IPC
ipcMain->>restrictIpcToAppFrames: Dispatch wrapped listener
restrictIpcToAppFrames->>isTrustedSender: Check sender frame and app URL
isTrustedSender-->>restrictIpcToAppFrames: Return trust result
restrictIpcToAppFrames->>RegisteredCallback: Forward trusted event
Merge Risk: 
Minimal · up to 64caa
-
External Markdown links are handled by the system browser rather than opening an Electron window. The change is mergeable after normal checks.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title "fix: avoid internal link from all places" is related to the main change. The PR makes Markdown links open externally in all renderers (AI chat sidebar, query editor completion hints, GraphQL docs) and adds the trusted-URL checks in Electron. The title is short and specific enough, but it does not name the Electron hardening (context isolation, IPC restriction, scheme filtering), which is a large part of the changeset. The wording "internal link" is slightly vague, but the core intent is clear.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 15 files. (1 skipped: 1 unsupported.)
-
Finishing Touches: 💡 1
-
🛠️ Fix failing CI checks: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Markdown links gain a careful frame,
Safe attributes now mark their name.
App URLs guide each window’s way,
IPC checks each frame’s relay.
Electron keeps the boundaries clear.
Comment @coderabbitai help to get the list of available commands.
…ng context isolation and disabling node integration
|
can we add an e2e test that clicks a link and asserts that the main window URL remains unchanged? |
Description
Contribution Checklist:
Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.
Publishing to New Package Managers
Please see here for more information.
Summary by CodeRabbit