Skip to content

feat: Add chromiumBrowser option to target specific Chromium browser on macOS#2

Open
ainergiz wants to merge 1 commit intosteipete:mainfrom
ainergiz:feat/chromium-browser-option
Open

feat: Add chromiumBrowser option to target specific Chromium browser on macOS#2
ainergiz wants to merge 1 commit intosteipete:mainfrom
ainergiz:feat/chromium-browser-option

Conversation

@ainergiz
Copy link

@ainergiz ainergiz commented Jan 3, 2026

Summary

Adds a chromiumBrowser option to specify which Chromium-based browser to target on macOS (Chrome, Brave, Arc, or generic Chromium). This avoids triggering multiple macOS keychain prompts when multiple Chromium browsers are installed.

Changes

  • Added chromiumBrowser?: 'chrome' | 'brave' | 'arc' | 'chromium' to GetCookiesOptions
  • Pass the option through to getCookiesFromChrome() in public.ts
  • The existing chrome.ts provider already supports this via its options

Use Case

When a user knows they want cookies from Brave specifically, they can set chromiumBrowser: 'brave' to avoid keychain prompts for Chrome, Arc, etc.

Closes #1

…on macOS

Adds `chromiumBrowser` option to specify which Chromium-based browser to target
on macOS (chrome, brave, arc, chromium).

When using `browsers: ['chrome']` on macOS with multiple Chromium browsers
installed, sweet-cookie tries each browser's keychain entry sequentially,
causing multiple password prompts.

The new `chromiumBrowser` option lets callers specify exactly which browser
to target, resulting in a single keychain prompt:

```typescript
const { cookies } = await getCookies({
  url: 'https://example.com',
  browsers: ['chrome'],
  chromiumBrowser: 'brave', // Only try Brave's keychain entry
});
```

This is backwards compatible - when omitted, behavior is unchanged.

Closes steipete#1
ainergiz added a commit to ainergiz/xfeed that referenced this pull request Jan 3, 2026
The npm version of sweet-cookie doesn't have the chromiumBrowser option
yet (awaiting upstream PR steipete/sweet-cookie#2). Without it, selecting
Brave/Arc prompts for Chrome's keychain instead of the correct one.

This vendored version includes the chromiumBrowser option, which tells
sweet-cookie which specific Chromium browser's keychain to use for
cookie decryption.

Once the upstream PR is merged and published, we can switch back to npm.

Fixes #100

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ainergiz added a commit to ainergiz/xfeed that referenced this pull request Jan 3, 2026
)

* fix(auth): Support Brave, Arc, and Opera browser cookie extraction

Pass explicit cookie database paths when source is Brave, Arc, or Opera,
so sweet-cookie only accesses that browser's keychain entry. This ensures
a single password prompt instead of multiple prompts for different
Chromium browsers.

This is a workaround until steipete/sweet-cookie#1 adds the
chromiumBrowser option. See #100 for tracking.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(auth): Use vendored sweet-cookie with chromiumBrowser support

The npm version of sweet-cookie doesn't have the chromiumBrowser option
yet (awaiting upstream PR steipete/sweet-cookie#2). Without it, selecting
Brave/Arc prompts for Chrome's keychain instead of the correct one.

This vendored version includes the chromiumBrowser option, which tells
sweet-cookie which specific Chromium browser's keychain to use for
cookie decryption.

Once the upstream PR is merged and published, we can switch back to npm.

Fixes #100

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.

chromiumBrowser option to target specific Chromium browser on macOS

1 participant