Skip to content

cookie-import-browser fails on Linux — macOS-only path detection #265

Closed

Description

@kohai-ut

My claude code on wsl (debian) claims the cookie's can't be imported for this reason. I'm not sure if it is lying to me, but thought I'd pass this along.

Title: cookie-import-browser fails on Linux — macOS-only path detection

Environment:

  • OS: Ubuntu on WSL2 (Linux 6.6.87.2-microsoft-standard-WSL2)
  • gstack version: 0.9.4.1
  • Browser: google-chrome-stable installed at /usr/bin/google-chrome-stable
  • Chrome profile: ~/.config/google-chrome/Default/
  • Cookie DB exists: ~/.config/google-chrome/Default/Cookies (36KB, valid SQLite)

What happens:
$ browse cookie-import-browser
[browse] Starting server...
No Chromium browsers found. Supported: Comet, Chrome, Arc, Brave, Edge

Root cause:

findInstalledBrowsers() in browse/src/cookie-import-browser.ts (line ~106) is hardcoded to macOS paths:

export function findInstalledBrowsers(): BrowserInfo[] {
const appSupport = path.join(os.homedir(), 'Library', 'Application Support');
return BROWSER_REGISTRY.filter(b => {
const dbPath = path.join(appSupport, b.dataDir, 'Default', 'Cookies');
try { return fs.existsSync(dbPath); } catch { return false; }
});
}

It only checks ~/Library/Application Support//Default/Cookies (macOS). On Linux, Chrome stores cookies at
~/.config/google-chrome/Default/Cookies, which is never checked.

Additionally, the cookie decryption uses macOS Keychain (keychainService field in BROWSER_REGISTRY). On Linux, Chrome encrypts cookies
using PBKDF2 with either a GNOME Keyring-stored key or the hardcoded password "peanuts" with salt "saltysalt" (1 iteration, 16-byte
AES-128-CBC key).

What needs to change:

  1. Platform-aware path detection — check ~/.config/google-chrome/ on Linux, ~/Library/Application Support/Google/Chrome/ on macOS
  2. Platform-aware cookie decryption — use PBKDF2 "peanuts" key (or GNOME Keyring/libsecret) on Linux instead of macOS Keychain
  3. Update BROWSER_REGISTRY with per-platform dataDir values

Linux Chrome data directories:

  • Chrome: ~/.config/google-chrome/
  • Brave: ~/.config/BraveSoftware/Brave-Browser/
  • Edge: ~/.config/microsoft-edge/
  • Chromium: ~/.config/chromium/

Activity

  1. added a commit that references this issue on Mar 21, 2026
    3727e3f
  2. mvanhorn commented on Mar 21, 2026

    @mvanhorn
    Contributor

    Implemented in #270 - adds platform-aware path detection and key derivation for Linux Chromium browsers.

  3. garrytan commented on Mar 23, 2026

    @garrytan
    Owner

    Fixed in PR #275 (merged in Wave 3, #359). Linux cookie import now works for Chrome, Chromium, Brave, and Edge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions