Skip to content

Add Zen Browser support - #118

Open
jeremy-albinet wants to merge 1 commit into
browserutils:masterfrom
jeremy-albinet:add-zen-browser
Open

Add Zen Browser support#118
jeremy-albinet wants to merge 1 commit into
browserutils:masterfrom
jeremy-albinet:add-zen-browser

Conversation

@jeremy-albinet

Copy link
Copy Markdown

What

Adds Zen Browser as a supported CookieStoreFinder.

Zen is a Firefox fork that keeps its own profile tree, separate from Firefox's, so kooky's existing Firefox finder never discovers it, even though Zen writes profiles.ini, cookies.sqlite, and sessionstore*.jsonlz4 in Firefox's exact formats.

Approach

  • New browser/zen package, following browser/firefox's pattern exactly: a CookieStoreFinder that calls firefox.CookieStoresForProfiles — so it gets both the SQLite cookie store and the session-restore cookie store for free.
  • New zenRoots in internal/firefox/find, mirroring firefoxRoots, covering:
  • Added find.FindZenProfiles() alongside the existing FindFirefoxProfiles(), reusing FindProfiles/FindProfilesInRoot unchanged since the ini format is identical.

Testing

  • go build ./... / go vet ./... clean.
  • Cross-compiled clean for darwin, linux, windows (amd64 + arm64) and android/arm64.
  • Verified end-to-end against a real Zen install: correctly discovers the profile under ~/Library/Application Support/zen/Profiles/, reads user_session/__Host-user_session_same_site from cookies.sqlite (labeled browser=zen), and also picks up cookies from sessionstore-backups/recovery.jsonlz4, matching Firefox's existing fidelity.
  • Existing test suite (go test ./...) is unaffected.

Context

Filed after adding Zen support to a downstream tool (drogers0/gh-image) whose README already documents a manual sqlite3-based workaround for unsupported Firefox forks — this closes that gap for Zen specifically.

Zen (https://zen-browser.app) is a Firefox fork that keeps its own
profile tree separate from Firefox's, so kooky's existing Firefox
finder never discovers it.

Adds a browser/zen package registered as a CookieStoreFinder, plus a
zenRoots profile-root discovery function (mirroring firefoxRoots) per
platform:
  - macOS:   ~/Library/Application Support/zen
  - Windows: %AppData%\zen
  - Linux:   ~/.zen (tarball/AUR), ~/.var/app/app.zen_browser.zen/.zen
             (Flatpak), and ~/.config/zen (newer XDG-following builds,
             zen-browser/desktop#12366)

Zen's profiles.ini is Firefox's format verbatim, and its cookies.sqlite
and sessionstore.jsonlz4 use the same schema, so this reuses
FindProfiles/FindProfilesInRoot and CookieStoresForProfiles as-is —
only the root-discovery layer is new.

Verified against a real Zen install: correctly discovers the profile,
reads user_session/__Host-user_session_same_site from cookies.sqlite,
and picks up sessionstore-backups cookies the same way Firefox does.
Cross-compiled clean for darwin/linux/windows (amd64+arm64) and
android/arm64.
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