Skip to content

Open links Ctrl-clicked in Herdr in the browser window that clicked them - #70

Merged
dibin666 merged 1 commit into
masterfrom
open-links-in-browser
Oct 14, 2026
Merged

dibin666 merged 1 commit into
masterfrom
open-links-in-browser

Conversation

@dibin666

Copy link
Copy Markdown
Owner

Herdr opens a Ctrl-clicked link from the client that saw the click by running xdg-open/open from its PATH. A browser window's client runs on the workstation, so links opened on the workstation's desktop.

  • On Linux and macOS each window's Herdr client gets a PATH with stand-ins for those commands; they hand a lone web link and the window's stream to the connector over a private socket (links.sock, 0600).
  • New open_link message: host → relay (http/https only, ≤ 8,192 chars) → that window only, which opens it with noopener,noreferrer.
  • Only enabled when the relay's host_ready announces the open_link capability; anything else falls back to the real command.

Verified end to end against a real Herdr 0.9.4 client (Ctrl-click → connector). 812 lines, slightly over the guideline, mostly tests.

Herdr opens a Ctrl-clicked link from the client that saw the click, by
running xdg-open or open from its PATH. A browser window's client runs on the
workstation, so the link opened on the workstation's desktop, out of sight
of the phone or laptop that clicked it.

On Linux and macOS each window's Herdr client now starts with a PATH that
finds stand-ins for those two commands first. A stand-in hands a lone web
link and the window's stream to the host connector over a private socket,
the connector sends it to the relay as open_link, and the relay passes it,
http and https only, to that window, which opens it in a new tab. Anything
else, a window that has gone or a connector that does not answer runs the
real command. The connector only does this when the relay's host_ready
announces open_link, so an older relay keeps links opening on the
workstation as before.
@dibin666
dibin666 merged commit 6c971b7 into master Oct 14, 2026
2 checks passed
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.

1 participant