Skip to content

Add Windows cookie extraction support for Gemini browser mode #51

Description

@prathamdby

Problem

Gemini browser mode fails on Windows with:

ERROR: Gemini browser mode requires Chrome cookies for google.com (missing __Secure-1PSID/__Secure-1PSIDTS).

Root Cause

  • Gemini executor uses chrome-cookies-secure which doesn't work on Windows (requires macOS Keychain/Linux keyring)
  • Windows cookie extraction exists (src/browser/windowsCookies.ts) but is hardcoded to chatgpt.com only (line 130)
  • Windows cookie sync is disabled in loadChromeCookies() (line 31-35)

Solution

  1. Make loadWindowsCookies() domain-agnostic, add domainFilter parameter to readChromeCookiesDb() to support google.com (currently hardcoded to chatgpt.com)
  2. Add Windows-specific loader in Gemini executor, create loadGeminiCookiesFromWindows() that uses loadWindowsCookies() with 'google.com' filter
  3. Integrate into Gemini executor, try Windows extraction first on Windows before falling back to chrome-cookies-secure
  4. Export resolveCookieFilePath() from chromeCookies.ts for cookie path resolution

Files to Modify

  • src/browser/windowsCookies.ts, add domain filter parameter
  • src/gemini-web/executor.ts, add Windows cookie loader
  • src/browser/chromeCookies.ts, export resolveCookieFilePath

Dependencies

All required dependencies already exist (DPAPI via @primno/dpapi, sqlite3, PowerShell)

Note

App-bound cookies (v20) may still fail DPAPI decryption, which is why Windows cookie sync was originally disabled. This should work for most cases.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions