{{ message }}
fix(gui): open external links in the system browser via opener plugin#3231
Open
ibell wants to merge 1 commit into
Open
fix(gui): open external links in the system browser via opener plugin#3231ibell wants to merge 1 commit into
ibell wants to merge 1 commit into
Conversation
Bare `<a target="_blank">` anchors do not open the system browser in a Tauri v2 webview, so the About-dialog links (CoolProp repo, Sponsor, SignPath.io / SignPath Foundation) and the header Sponsor button were effectively unclickable. Add `tauri-plugin-opener`, register it, and grant a least-privilege capability (`opener:allow-open-url` + `opener:allow-default-urls`, i.e. http/https/mailto/tel only — no open-path or reveal-item-in-dir) to the main window. Route every external link through a shared `ExternalLink` component that intercepts the click and calls `openUrl()`, keeping `href`/`rel` for accessibility and the right-click "copy link" affordance. Applied in AboutModal, the header Sponsor button (App.tsx), and the SponsorSplash CTA. The `src-tauri/gen/schemas/*.json` change is tauri-build's regenerated ACL manifest reflecting the new capability. Verified: `tsc --noEmit` clean, `vitest` 21/21 pass, `cargo check` clean. Closes #3230 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
In the Tauri desktop GUI (
wrappers/GUI/), the external links in the About dialog (CoolProp repo, GitHub Sponsors, SignPath.io, SignPath Foundation) did nothing when clicked — no browser opened. The header 💚 Sponsor button and the SponsorSplash call-to-action had the same latent bug.Cause
The links were bare
<a href="…" target="_blank" rel="noreferrer">anchors. In a Tauri v2 webview, default navigation fortarget="_blank"does not open the system browser, and theopenerplugin was never wired up, so the clicks were silently dropped.Fix
Add
tauri-plugin-openerand route every external link through itsopenUrl()API:src-tauri/Cargo.toml+src-tauri/src/lib.rs— depend on and registertauri-plugin-opener.src-tauri/capabilities/opener.json— new least-privilege capability grantingopener:allow-open-url+opener:allow-default-urls(http/https/mailto/tel only) to themainwindow. Deliberately excludesopen-pathandreveal-item-in-dir.package.json— add@tauri-apps/plugin-opener.src/components/ExternalLink.tsx(new) — shared anchor that intercepts the click, callsopenUrl(href), and keepshref/relfor accessibility and the right-click "copy link" menu.AboutModal.tsx, the header Sponsor button (App.tsx), andSponsorSplash.tsx.src/test/setup.ts— stubopenUrlso jsdom tests resolve cleanly.src-tauri/gen/schemas/*.jsonare tauri-build's regenerated ACL manifests reflecting the new capability.Verification
tsc --noEmitcleanvitest21/21 passcargo checkclean (tauri-build validates the capability)./dev/ci/preflight.shpassed (C/C++ checks correctly skipped — GUI-only diff)Closes #3230
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes