Skip to content

feat: support Firefox Flatpak native messaging - #174

Merged
dantraynor merged 1 commit into
mainfrom
feat/firefox-flatpak
Nov 14, 2026
Merged

dantraynor merged 1 commit into
mainfrom
feat/firefox-flatpak

Conversation

@dantraynor

@dantraynor dantraynor commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

What

Adds tailchrome install --firefox-flatpak and tailchrome uninstall --firefox-flatpak for Flatpak Firefox (org.mozilla.firefox).

  • The helper is staged at ~/.var/app/org.mozilla.firefox/tailchrome/host/tailchrome, and the manifest is written to ~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts/com.tailscale.browserext.firefox.json. Inside the sandbox, Firefox sees that folder as ~/.mozilla/native-messaging-hosts.
  • The Chrome Flatpak installer now takes a browser target, so Firefox gets the same ownership receipt, lock, active-browser check, rollback and symlink rejection. The Firefox manifest only allows the AMO add-on ID. --extension-dir stays Chrome-only.
  • hostStateDir now recognizes both Flatpak app IDs, so a helper started by Firefox Flatpak keeps node state in ~/.var/app/org.mozilla.firefox/config/tailscale-browser-ext.
  • scripts/test-flatpak.sh takes chrome|firefox, and flatpak-smoke.yml runs both.
  • Docs: a new "Firefox Flatpak" section in docs/helper-installation.md, plus small updates to the docs that mention Chrome Flatpak.

Why

Closes #163

The workaround in the issue needs flatpak override --filesystem=home because the manifest points at the native helper, which sits outside the sandbox. Staging the helper inside the app directory, as Chrome Flatpak already does, avoids widening the sandbox.

Users already on the workaround: the installer won't overwrite a manifest it doesn't own, so they have to delete the copied one first. Their node state also moves into the sandbox, so they sign in once more. Both are covered in the docs.

How to Test

  • go test ./... passes on Linux (container, non-root) and macOS. go vet passes for both OSes.
  • shellcheck and actionlint pass on the changed script and workflow.
  • The Flatpak helper smoke (firefox) job passes: the helper starts inside the Firefox sandbox and answers procRunning and pong.
  • Manual check on a Linux machine with Flathub Firefox: add-on installed, Firefox closed, tailchrome install --firefox-flatpak, then reopen Firefox and confirm the popup connects, login works and traffic is routed. Then run tailchrome uninstall --firefox-flatpak with Firefox closed.

Checklist

  • Tested in Chrome
  • Tested in Firefox
  • Updated README if needed (the README already links to helper-installation.md, which has the new section)

Add `tailchrome install --firefox-flatpak` / `uninstall --firefox-flatpak`.
The helper is staged inside ~/.var/app/org.mozilla.firefox and the manifest
is written to the sandbox's ~/.mozilla/native-messaging-hosts, so no
`flatpak override --filesystem=home` is needed. The Chrome Flatpak installer
is generalized over a browser target and keeps its ownership, locking, and
rollback guarantees. A helper launched by Firefox Flatpak now keeps node
state in the sandbox's XDG config directory.

The Flatpak smoke script and workflow now cover Chrome and Firefox.

Closes #163
@dantraynor
dantraynor merged commit 21e54b5 into main Nov 14, 2026
20 checks passed
@dantraynor
dantraynor deleted the feat/firefox-flatpak branch November 14, 2026 04:13
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.

Firefox flatpak support

1 participant