Add Zen Browser support - #53
Conversation
Registers Zen (https://zen-browser.app) alongside the other supported browsers by blank-importing kooky's new browser/zen finder (browserutils/kooky#118 — not merged/released yet, hence the go.mod replace directive pinning to that PR branch as a resolved pseudo- version; remove the replace once it merges and ships in a release). Zen is a Firefox fork that keeps its own profile tree separate from Firefox's, so it wasn't discovered by the existing Firefox finder even though it shares Firefox's cookie/profile formats exactly. Verified end-to-end with cookies.GetGitHubSession() against a real Zen install: correctly finds the user_session cookie from ~/Library/Application Support/zen/Profiles/<profile>/cookies.sqlite. go build/vet/test all pass; go.sum updated by go mod tidy.
|
Thanks @jeremy-albinet. Kooky is in an awkward spot right now (#44): merging this means shipping a release that v1.3.0 added an alternate, more actively-maintained cookie backend, HackBrowserData, selectable at build time ( In the meantime, Zen users on v1.3.0 have a workaround that avoids browser cookies entirely: if you have a I'll leave this open for tracking, but to be upfront, I wouldn't expect movement on it as it stands in the near term. |
|
Hey @drogers0 I'll start using gh token on my side to test it also |
What
Adds Zen Browser (a Firefox fork) to the list of browsers
gh imagecan read theuser_sessioncookie from.Why
Hit
no session token foundbecause Zen's cookies aren't in any of the currently-searched stores — Zen keeps its own profile tree (~/Library/Application Support/zen/Profiles/…on macOS,~/.zen/ Flatpak / newer XDG paths on Linux,%AppData%\zenon Windows), separate from Firefox's. The README's session-token override section already documents a manualsqlite3-based workaround for unsupported Firefox forks (Floorp, LibreWolf); this closes that gap for Zen with native, automatic detection instead.Approach
Rather than reimplementing Firefox-fork cookie parsing inside this repo, I upstreamed proper Zen support into
kookyitself, matching how every other browser here is wired (a blank-importedkooky.CookieStoreFinder):browser/zen, mirroringbrowser/firefox's architecture exactly — same profiles.ini format, samecookies.sqlite/sessionstore.jsonlz4schema, just a different profile-root search. Verified end-to-end against a real Zen install; cross-compiles clean for darwin/linux/windows (amd64+arm64) and android/arm64.kooky/browser/zenininternal/cookies/cookies.go(identical one-line pattern to the other seven browsers), updates the "no session found" message, and updates docs.Since kooky#118 isn't merged/released yet,
go.modcarries areplacedirective pinning to that PR branch as a resolved pseudo-version (reproducible, doesn't depend on the branch continuing to exist). This should be removed once kooky#118 merges and ships in a release — swap to the realrequireversion and rungo mod tidy. Flagged with a TODO indocumentation/architecture.md's Dependencies section. Happy to hold this PR until kooky#118 merges instead, if you'd rather not carry a temporaryreplace— whichever you prefer.Testing
go build/vet/test ./...all pass.cookies.GetGitHubSession(nil)against a real Zen install: correctly finds and returns theuser_sessioncookie from the Zen profile'scookies.sqlite.gofmt -l .clean.