Releases: steipete/sweet-cookie
Releases · steipete/sweet-cookie
v0.2.0
Fixed
- Add explicit macOS
chromiumBrowsertargeting so callers can pick a specific Chromium-family browser without changing default Chrome behavior. (#2, thanks@ainergiz) - Support Brave cookie decryption on Linux and macOS by selecting Brave-specific Safe Storage secrets and profile roots. (
#15, thanks@LucasAIBuilder) - Respect
timeoutMsfor macOS Chrome Keychain access so slow or interactive prompts can use the caller-provided timeout. (#9, thanks@natustx) - Fall back to GNOME
application=keyring lookups for Chrome and Edge when the legacyservice/accountlookup is empty. (#13, thanks@Clausinho) - Drop Firefox cookie expiries beyond year 9999 instead of emitting invalid downstream timestamps. (
#22, thanks@WinnCook) - Cast Chromium
expires_utcto text on runtimes withoutreadBigIntssupport to avoidnode:sqliteoverflow failures. (#3, thanks@Saik0s)
v0.1.0
Initial release.
Added
-
@steipete/sweet-cookielibrarygetCookies(options)API: best-effort cookie extraction from inline payloads and/or local browsers, returning{ cookies, warnings }.toCookieHeader(cookies, options)helper: builds an HTTPCookieheader string with optional sort +dedupeByName.- Inline-first flow: inline payloads short-circuit browser reads when they produce any cookies.
- Inline inputs:
inlineCookiesJson: acceptsCookie[]or{ cookies: Cookie[] }.inlineCookiesBase64: base64-encoded JSON (same shapes as above).inlineCookiesFile: file path; also a heuristic for*.json/*.base64inputs.
- Origin filtering:
urldefines the default origin scope.originsadds extra origins (OAuth/SSO, multi-domain auth).- Host matching supports parent-domain cookies (e.g.
.google.comforgemini.google.com).
- Cookie filtering and shaping:
- Optional
namesallowlist. includeExpiredtoggle (default: exclude expired).- Emits tool-friendly
Cookieobjects (name,value,domain,path, optionalexpires,secure,httpOnly,sameSite, plussourcemetadata).
- Optional
- Source behavior controls:
browsersordered sources (chrome,edge,firefox,safari).mode:merge(default) to merge across backends, orfirstto return the first backend that yields cookies.- Profile selectors:
- Chromium:
profile,chromeProfile,edgeProfileaccept profile name, profile dir path, or cookie DB path. - Firefox:
firefoxProfileaccepts profile name or dir path (resolvescookies.sqlite). - Safari:
safariCookiesFileoverride (tests/debug).
- Chromium:
- Cross-runtime SQLite support: Node
node:sqlite(Node >= 22) orbun:sqlite(Bun). - Robust locked-DB behavior: for Chromium + Firefox providers, copies cookie DB (+
-wal/-shmwhen present) to a temp snapshot before reading. - Warnings model: providers return non-fatal diagnostics and never include raw cookie values.
-
Browser providers (library)
- Chrome (Chromium cookie DB; modern schemas only)
- macOS: reads “Chrome Safe Storage” from Keychain via
security; AES-128-CBC cookie decrypt. - Linux: supports v10 (“peanuts”) + v11 (keyring “Safe Storage”); keyring probing via
secret-tool(GNOME) orkwallet-query+dbus-send(KDE). - Windows: reads “Local State” DPAPI-wrapped master key via PowerShell; AES-256-GCM cookie decrypt (v10/v11/v20).
- Chromium meta-version support: strips the 32-byte hash prefix from decrypted values when present.
- macOS: reads “Chrome Safe Storage” from Keychain via
- Edge (Chromium cookie DB; modern schemas only)
- macOS: reads “Microsoft Edge Safe Storage” from Keychain via
security; AES-128-CBC cookie decrypt. - Linux: supports v10 (“peanuts”) + v11 (keyring “Safe Storage”) via
secret-toolorkwallet-query+dbus-send. - Windows: reads “Local State” DPAPI-wrapped master key via PowerShell; AES-256-GCM cookie decrypt (v10/v11/v20).
- macOS: reads “Microsoft Edge Safe Storage” from Keychain via
- Firefox (cookies.sqlite)
- macOS/Linux/Windows: reads
cookies.sqlitevia Node/Bun SQLite, with profile discovery anddefault-releasepreference when present.
- macOS/Linux/Windows: reads
- Safari (Cookies.binarycookies)
- macOS: parses
Cookies.binarycookiesdirectly (no WebKit DB dependency), including common container locations.
- macOS: parses
- Chrome (Chromium cookie DB; modern schemas only)
-
Env configuration (library)
SWEET_COOKIE_BROWSERS/SWEET_COOKIE_SOURCES: default browser order (comma/space-separated).SWEET_COOKIE_MODE:mergeorfirst.SWEET_COOKIE_CHROME_PROFILE,SWEET_COOKIE_EDGE_PROFILE,SWEET_COOKIE_FIREFOX_PROFILE.- Linux keyrings:
SWEET_COOKIE_LINUX_KEYRING=gnome|kwallet|basic(or auto-detect).SWEET_COOKIE_CHROME_SAFE_STORAGE_PASSWORD,SWEET_COOKIE_EDGE_SAFE_STORAGE_PASSWORDoverrides.
-
apps/extension(Chrome MV3 inline cookie exporter)- Export UI:
- Target URL (defaults to active tab URL).
- Extra origins (multi-line) for multi-domain auth.
- Cookie allowlist (comma-separated names).
- Live preview (counts + domains + redacted sample values).
- Permissions model:
- Requests optional host permissions at export-time for computed origins.
- Fails closed with a clear error when permissions are denied.
- Outputs:
- Copy JSON to clipboard.
- Copy base64 (clipboard-friendly).
- Download JSON file.
- Payload schema
version: 1with provenance metadata (generatedAt,source,browser,targetUrl,origins,cookies).
- Cookie collection:
- Merges cookies across origins and dedupes by
name|domain|path|storeId. - Maps Chrome cookie fields to Sweet Cookie’s CDP-ish cookie shape and normalizes
sameSite.
- Merges cookies across origins and dedupes by
- Export UI: