Skip to content

feat: support Edge browser cookie import for Codex provider#521

Open
Astro-Han wants to merge 7 commits intosteipete:mainfrom
Astro-Han:feat/edge-browser-cookie-support
Open

feat: support Edge browser cookie import for Codex provider#521
Astro-Han wants to merge 7 commits intosteipete:mainfrom
Astro-Han:feat/edge-browser-cookie-support

Conversation

@Astro-Han
Copy link
Contributor

@Astro-Han Astro-Han commented Mar 13, 2026

Summary

  • Replace hardcoded Safari/Chrome/Firefox switch in OpenAIDashboardBrowserCookieImporter.trySource with a generic tryBrowser method that handles any non-Safari browser
  • Edge (and all other Chromium-based browsers like Brave, Arc, Vivaldi) were silently ignored because default: nil dropped them — now they route through the same cookie loading path via SweetCookieKit
  • Net code reduction: 62 lines removed, 14 added

Context

SweetCookieKit already has full Edge support (enum, profile paths, keychain labels, decryption). Other providers (MiniMax, Augment, Kimi) already iterate all browsers generically. The Codex/OpenAI web cookie importer was the only place still using a closed browser list.

Closes #372

Test plan

  • swift build passes
  • swift test passes — 8 pre-existing Claude OAuth keychain test failures are unrelated (they depend on real keychain credentials not present in dev environments, same failures on main)
  • swiftformat and swiftlint --strict pass
  • Manual: install Edge on macOS, sign into chatgpt.com, verify CodexBar picks up Codex session cookies from Edge

No new unit tests added: the original tryChrome/tryFirefox had no unit tests either, as trySource depends on real browser cookie stores and Keychain access. The existing OpenAIDashboardBrowserCookieImporterTests only covers error message formatting.

Astro-Han and others added 7 commits March 13, 2026 11:30
…te#506)

Write the resolved refreshFrequency value to UserDefaults when the key
is absent, matching the pattern used by sessionQuotaNotificationsEnabled
and other settings. This ensures the key appears in the plist from the
very first run and survives app restarts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Also write back the resolved default when UserDefaults contains an
unrecognized rawValue, preventing silent fallback on every launch.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract parsed result into a local variable to avoid calling flatMap
twice, matching the three-step pattern used by other settings. Add test
for unrecognized rawValue repair on init.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…mport

Replace separate tryChrome/tryFirefox methods with a generic tryBrowser
that handles any non-Safari browser. Previously the trySource switch
only matched .safari/.chrome/.firefox, silently ignoring Edge, Brave,
Arc and all other browsers detected by SweetCookieKit.

Closes steipete#372
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.

Feature Request: Add Microsoft Edge browser cookie support for macOS

1 participant