Skip to content

fix: open external links in the OS browser on Standalone#2816

Merged
rafaellehmkuhl merged 1 commit into
bluerobotics:masterfrom
rafaellehmkuhl:issue-2612-external-links-os-browser
Jul 3, 2026
Merged

fix: open external links in the OS browser on Standalone#2816
rafaellehmkuhl merged 1 commit into
bluerobotics:masterfrom
rafaellehmkuhl:issue-2612-external-links-os-browser

Conversation

@rafaellehmkuhl

Copy link
Copy Markdown
Member

Opens external links in the OS preferred browser instead of in an Electron window.

To test it, just open /menu/about and click the links there.

Fixes #2612

Electron opened http(s) links in a new BrowserWindow instead of the
user's default browser. Route external links through shell.openExternal
via setWindowOpenHandler and will-navigate, keeping in-app navigation
inside Cockpit.
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Automated PR Review (Claude)

0. Summary

Verdict: READY TO MERGE

This single-commit PR fixes external links (http/https/mailto) in the Electron (Standalone) build so they open in the OS default browser instead of spawning a new BrowserWindow. It adds a setWindowOpenHandler for target="_blank" / window.open links and a will-navigate listener for in-page navigations, both in src/electron/main.ts. The change is small, well-scoped, and uses Electron's recommended APIs correctly.

1. Correctness & Implementation Bugs — ✅

2. AGENTS.md Adherence — ✅

3. Security — ✅

4. Performance — ✅

5. UI / UX — ✅

6. Code Quality & Style — ✅

7. Commit Hygiene — ✅

8. Tests — ✅

9. Documentation — ✅

10. Nitpicks / Optional

10.1 nitsrc/electron/main.ts (diff line 17): The will-navigate handler checks url.startsWith('http:') || url.startsWith('https:') after already confirming !isInternal. Since isInternal is only true for file: or the dev-server URL, the http/https guard is redundant for production (where non-internal is always http/https). It's still a reasonable belt-and-suspenders check for safety, so no action needed — just noting it.

Generated by Claude. This is advisory; a human reviewer must still approve.

@rafaellehmkuhl

Copy link
Copy Markdown
Member Author

Automated PR Review (Claude)

Will ignore the nit.

@rafaellehmkuhl rafaellehmkuhl requested review from ArturoManzoli and removed request for ArturoManzoli July 1, 2026 23:40
@rafaellehmkuhl rafaellehmkuhl merged commit 302bba6 into bluerobotics:master Jul 3, 2026
12 checks passed
@rafaellehmkuhl rafaellehmkuhl deleted the issue-2612-external-links-os-browser branch July 3, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

External links open in Electron instead of the OS preferred browser

2 participants