fix: add Linux cookie path detection and key derivation#270
Open
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
Open
fix: add Linux cookie path detection and key derivation#270mvanhorn wants to merge 1 commit intogarrytan:mainfrom
mvanhorn wants to merge 1 commit intogarrytan:mainfrom
Conversation
cookie-import-browser was hardcoded to macOS paths (~/Library/Application Support/) and macOS Keychain for cookie decryption. On Linux, Chromium stores cookies at ~/.config/<browser>/ and encrypts them with PBKDF2 using the hardcoded password "peanuts" (salt "saltysalt", 1 iteration). Changes: - Add linuxDataDir field to BrowserInfo for per-platform cookie paths - Add Chromium browser entry (Linux-only, ~/.config/chromium/) - Platform-aware path resolution in findInstalledBrowsers() and getCookieDbPath() - Platform-aware key derivation: Linux uses "peanuts" PBKDF2 (1 iter), macOS uses Keychain PBKDF2 (1003 iter) - Filter browser list to platform-available browsers in resolveBrowser() Fixes garrytan#265
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cookie-import-browser.tsis hardcoded to macOS paths and Keychain decryption. On Linux,findInstalledBrowsers()checks~/Library/Application Support/which doesn't exist, so it reports "No Chromium browsers found" even when Chrome is installed at~/.config/google-chrome/.Changes
linuxDataDirfield toBrowserInfofor Linux cookie paths (~/.config/<browser>/)findInstalledBrowsers()(browse/src/cookie-import-browser.ts:108) andgetCookieDbPath()(:215)getDerivedKey()(:280): Linux Chromium uses PBKDF2 with hardcoded password "peanuts", salt "saltysalt", 1 iteration. macOS uses Keychain with 1003 iterations.resolveBrowser()to only show platform-available browsersAll macOS behavior is unchanged - Linux support is additive.
Testing
bun testpasses (2 pre-existing Codex generation failures unrelated to this change).Note
Aware of #39 which also addresses Linux cookie import with a broader scope (+295/-219 lines, including GNOME Keyring v11 support and profile flag fix). This PR is a smaller, focused fix (+43/-14) covering the core path detection and v10 decryption that #265 reports.
This contribution was developed with AI assistance (Claude Code).
Fixes #265