Skip to content

fix: fix external link opening in desktop#599

Merged
t3dotgg merged 1 commit intopingdotgg:mainfrom
Noojuno:fix-external-links
Mar 9, 2026
Merged

fix: fix external link opening in desktop#599
t3dotgg merged 1 commit intopingdotgg:mainfrom
Noojuno:fix-external-links

Conversation

@Noojuno
Copy link
Contributor

@Noojuno Noojuno commented Mar 9, 2026

What Changed

Added electron link handling for safe links so they open in an external browser.

I have validated that file links still open in Cursor, and that external links work in both the browser and desktop environment.

Why

Clicking on external links in the agent response was doing nothing rather than opening in an external browser.

Fixes #434

UI Changes

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Validate and open http/https external links from desktop by routing main.createWindow window-open requests and main.registerIpcHandlers OPEN_EXTERNAL through main.getSafeExternalUrl in main.ts

Add main.getSafeExternalUrl to normalize and guard URLs; update OPEN_EXTERNAL IPC handler and webContents.setWindowOpenHandler to use it and open validated links via shell.openExternal in main.ts.

📍Where to Start

Start with getSafeExternalUrl and its use in the OPEN_EXTERNAL IPC handler and webContents.setWindowOpenHandler in main.ts.

Macroscope summarized 015ee56.

@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8ed77cfb-45bd-4a18-9e9f-0d908a78bc11

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Noojuno Noojuno force-pushed the fix-external-links branch from 59f95a4 to 015ee56 Compare March 9, 2026 02:33
Comment on lines +127 to +129
if (parsedUrl.protocol !== "https:" && parsedUrl.protocol !== "http:") {
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about deep-linking into other apps etc?

Copy link
Contributor Author

@Noojuno Noojuno Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This project uses react-markdown, which has a default URL transform that wouldn't allow deep-linking into other apps: https://github.com/remarkjs/react-markdown?tab=readme-ov-file#defaulturltransformurl

It's probably a change worth making, but it is a larger change than I would like to PR in this project as-is (especially since they aren't really even accepting PR's in the first place)

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 9, 2026
@t3dotgg
Copy link
Member

t3dotgg commented Mar 9, 2026

A quick read suggests this might break opening code-file links in IDE, can you confirm those are fine? If so will merge

@Noojuno
Copy link
Contributor Author

Noojuno commented Mar 9, 2026

A quick read suggests this might break opening code-file links in IDE, can you confirm those are fine? If so will merge

@t3dotgg This PR works with Cursor links and external links.

screen-recording-compressed.mp4

vscode links (or other external apps) like vscode://file/path/to/file/file.ext:55:20 don't work with this change due to the above mentioned react-markdown default URL transform, but there's no regression of functionality there since they never worked, at least in my testing.

@t3dotgg
Copy link
Member

t3dotgg commented Mar 9, 2026

Legend ty!

@t3dotgg t3dotgg merged commit 651084e into pingdotgg:main Mar 9, 2026
3 checks passed
@github-actions github-actions bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. and removed vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open external link doesn't work - MacOS

3 participants