Tailtab README

The project's README from github.com/Stocist/Tailtab. As one markdown file: README.md.

Tailtab

Tailtab

A Tailscale node for each browser profile. Different profiles can sit on completely different tailnets at the same time.

CI License: BSD-3-Clause Go 1.27 tailscale.com v1.102.3 Platform: macOS · Edge · Zen Status: experimental

Tailtab popup, dark theme    Tailtab popup, light theme

What it does

How it works

flowchart LR
  B[Browser profile] -->|proxy rules| E[Tailtab extension]
  E <-->|native messaging| H[tailtab host<br/>Go + tsnet]
  E -->|127.0.0.1:port<br/>with credential| P[Loopback proxy<br/>HTTP + SOCKS5]
  P --> H
  H -->|WireGuard| T((Tailnet))

The basic setup is pretty simple.

The extension talks to a small Go host through native messaging. That host embeds tsnet, which means the host itself becomes the Tailscale node. It then exposes an authenticated HTTP/SOCKS5 proxy over loopback for the browser to use.

Chromium gets pointed at the proxy through a PAC script. Firefox decides whether to proxy each request itself. Both browsers use the same routing rules, with a shared fixture there to make sure the implementations do not slowly drift apart.

More detail is in docs/architecture.md.

Install

One command installs the host under your home directory and registers it with the browsers on the machine. No root or admin.

macOS / Linux:

curl -fsSL https://raw.githubusercontent.com/Stocist/Tailtab/main/scripts/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/Stocist/Tailtab/main/scripts/install.ps1 | iex

When upgrading on Windows, close all browsers that use Tailtab before rerunning the installer. It refuses to replace a running host rather than stopping your browser connections.

Both download the latest release, verify it against SHA256SUMS, and run tailtab install. Set TAILTAB_VERSION to pin a release. Then add the extension:

The host binary is not notarised or code-signed yet, so macOS may need a right-click Open the first time and Windows may show a SmartScreen warning. Linux and Windows hosts pass the same end-to-end smoke test in CI as macOS but have had less real use; reports welcome.

Chrome Flatpak on Linux needs both artifacts inside its sandbox. Use the opt-in Chrome Flatpak installation, not the native-browser one-liner above.

Build from source

You will need Go 1.27, Node 22, and either Microsoft Edge or Zen.

git clone https://github.com/Stocist/Tailtab.git && cd Tailtab
./scripts/build.sh
bin/tailtab install

build.sh builds the host binary and an unpacked extension for each browser.

install then writes the native-messaging manifests for Edge, Zen/Firefox and Chrome, pointing them at that binary.

If you move the repo afterwards, just run install again. bin/tailtab uninstall removes the files Tailtab added.

Load the extension in Edge
  1. Open edge://extensions.
  2. Turn on Developer mode.
  3. Click Load unpacked and select extension/dist/chromium/.
  4. Check that the extension ID is kejfineblfbjfolkgjkancapnpknomod. This is fixed by the key in the manifest.
  5. After rebuilding Tailtab, reload the extension from this page.

Edge likes to keep the old background worker around even after the browser restarts, so the popup shows a warning if the extension and host are out of sync.

Load the extension in Zen / Firefox
  1. Download tailtab-<version>.xpi from the latest release. It is signed by Mozilla for self-distribution, so it installs permanently.
  2. Open it in the browser (drag it onto a window, or File > Open File…) and accept the install prompt.
  3. If you want Tailtab in private windows, enable Run in Private Windows from about:addons.

For development, load extension/dist/firefox/manifest.json from about:debugging#/runtime/this-firefox with Load Temporary Add-on… instead. Firefox removes temporary extensions when the browser closes, so that one has to be loaded again after a restart.

Once that is done, open the popup and hit Connect.

Tailtab opens the normal Tailscale login page in a tab. Approve the node and the popup should switch to Connected, showing the tailnet, device name and assigned address.

From there:

http://wiki/ can reach a machine called wiki on your tailnet.

https://github.com still goes straight to the internet.

That is basically the idea.

A closer look

Account switcher   Exit node selected   Machine search

Security

There is a more complete write-up in docs/security.md, but the important bits are:

Status

Tailtab is still experimental, but it is at the point where I can actually daily drive it on macOS with Edge and Zen.

It is not in an extension store yet, so setup is still manual.

Chrome and Firefox should work with the existing implementations, but I have not properly tested them yet.

Chrome Flatpak on Bazzite has a contributor-tested setup; this is not comprehensive browser coverage.

Known limitations and security gaps are tracked in docs/security.md#known-gaps.

Development

./scripts/test.sh        # gofmt-clean Go, vet, tests, and the extension suite
./scripts/build.sh       # bin/tailtab + extension/dist/{chromium,firefox}

The extension tests load background.js and popup.js as-is into a stubbed browser environment with fake timers.

That lets the test suite cover things like proxy setup and teardown, reconnect backoff, split-tunnel routing and popup behaviour without needing to launch a real browser every time.

The host can also be driven manually. Native messaging is just 4-byte little-endian length-prefixed JSON over stdin/stdout.

Acknowledgements

The original idea and native-messaging structure are based on Tailscale's own ts-browser-ext experiment. Two files adapt code from it under the same BSD-3-Clause licence.

tailchrome takes a similar approach and was also useful to look through while building this.

Thanks to @Hajfi for reporting the Chrome Flatpak installation gap and documenting a working sandbox-compatible layout in #2.

License

BSD-3-Clause.

Tailtab (Stocist/Tailtab)

Searching Database…

这是什么?Tailtab 让每个浏览器配置文件拥有自己的 Tailscale 节点,这样不同的配置文件(甚至是不同的 Tailscale/Headscale 账号)可以同时位于完全隔离的 tailnet 上,而机器的其他部分不受影响。
这是浏览器扩展还是独立应用?它是一对组件:一个面向 Chrome、Edge、Firefox 或 Zen 的小型浏览器扩展,加上安装在你机器上的一个极简 Go 后台宿主。宿主内嵌了 Tailscale 的 tsnet 库并成为真正的 tailnet 节点;扩展只通过原生消息与它通信。
怎么让它跑起来?运行一行式安装器(macOS/Linux 上是 shell 脚本,Windows 上是 PowerShell),它会下载宿主、对照 SHA256SUMS 校验并注册原生消息清单,全程无需 root 或管理员权限;然后加载对应的扩展:Firefox/Zen 用已签名的 .xpi,Chrome/Edge 通过开发者模式加载解压的 zip。
除了安装器还需要什么,比如 Tailscale 账号?你需要一个 Tailscale 账号(或你指定指向的 Headscale/其他协调服务器),以便从弹出窗口登录;如果从源码构建而不是使用发布二进制,还需要 Go 1.27 和 Node 22。
安装上有什么坑或粗糙之处吗?宿主二进制尚未公证或代码签名,因此 macOS 首次运行需要右键“打开”,Windows 会显示 SmartScreen 警告;Chrome 和 Firefox 的测试不如 macOS/Edge 充分,Linux 上的 Chrome Flatpak 还需要一个感知沙箱的单独安装路径。
这些数据会以我无法控制的方式离开我的机器吗?有一处:内嵌的 tsnet 库会把自己的日志上传给 Tailscale,目前没有受支持的方法可以关闭这一点。
默认的分离隧道在这里究竟是什么意思?只有发往你 tailnet 的流量(MagicDNS 名称、.ts.net、tailnet 的 CGNAT 网段以及节点宣告的路由)会经过 Tailtab;该浏览器配置文件的所有其他请求都照常离开机器,因此日常浏览从不依赖 Tailtab 处于连接状态。
每个配置文件的出口节点是怎么工作的?你在弹出窗口中为某个浏览器配置文件选择一个出口节点,该配置文件的公共 Web 流量就会经由它路由,而私有网段保持本地。如果出口节点消失,Tailtab 会阻断流量,而不是让它直接泄露出去。
为什么不直接用常规的 Tailscale 应用?标准的 Tailscale 客户端给整台机器一个身份。Tailtab 让每个浏览器配置文件携带自己的节点密钥、状态和 tailnet,这样你可以并排运行多个账号或 tailnet,而不动计算机上的其他任何东西。
我能用自己的控制服务器代替 Tailscale 的吗?可以,设置页面允许你把 Tailtab 指向 Headscale(或任何兼容的)协调服务器,下次登录就会使用它。
Creator
Stocist
Size
1.4 MB
Stars
216
Age
1mo
Commits · 90 Days