Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions packages/desktop/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,23 @@ root?.addEventListener("mousewheel", (e) => {
e.stopPropagation()
})

// Intercept all link clicks and open external links in the default browser
root?.addEventListener("click", (e) => {
const target = e.target as HTMLElement
const anchor = target.closest("a")
if (!anchor) return

const href = anchor.getAttribute("href")
if (!href) return

// Only intercept external links (http/https)
if (href.startsWith("http://") || href.startsWith("https://")) {
e.preventDefault()
e.stopPropagation()
void shellOpen(href).catch(() => undefined)
}
})

render(() => {
const [serverPassword, setServerPassword] = createSignal<string | null>(null)
const platform = createPlatform(() => serverPassword())
Expand Down