[PR #7360] fix(desktop): open external links in system browser instead of webview #12364

Closed
opened 2026-02-16 18:17:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/7360

State: closed
Merged: Yes


Summary

  • External links in markdown content (AI responses) now open in the system's default browser instead of inside the Tauri webview

Problem

When clicking links in AI-generated markdown output in the desktop app, such as GitHub PR links, they were opening inside the Tauri webview rather than in the system's default browser. This happened because target="_blank" links bypass Tauri's on_navigation handler.

Solution

  • Changed the markdown link renderer to use class="external-link"
  • Added a global click listener in the desktop entry point that intercepts clicks on .external-link anchors and opens them via platform.openLink() (which uses Tauri's shell plugin)

This keeps the fix isolated to the desktop package while reusing the existing openLink platform API.

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/7360 **State:** closed **Merged:** Yes --- ## Summary - External links in markdown content (AI responses) now open in the system's default browser instead of inside the Tauri webview ## Problem When clicking links in AI-generated markdown output in the desktop app, such as GitHub PR links, they were opening inside the Tauri webview rather than in the system's default browser. This happened because `target="_blank"` links bypass Tauri's `on_navigation` handler. ## Solution - Changed the markdown link renderer to use `class="external-link"` - Added a global click listener in the desktop entry point that intercepts clicks on `.external-link` anchors and opens them via `platform.openLink()` (which uses Tauri's shell plugin) This keeps the fix isolated to the desktop package while reusing the existing `openLink` platform API.
yindo added the pull-request label 2026-02-16 18:17:16 -05:00
yindo closed this issue 2026-02-16 18:17:17 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12364