mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-12 15:42:20 +02:00
feat: support Chrome multi-profile cookie import
Previously cookie-import-browser only read from Chrome's Default profile, making it impossible to import cookies from other profiles (e.g. Profile 3). This was a common issue for users with multiple Chrome profiles. Changes: - Add listProfiles() to discover all Chrome profiles with cookie DBs - Read profile display names from Chrome's Preferences files - Add profile selector pills in the cookie picker UI - Pass profile parameter through domains/import API endpoints - Add --profile flag to CLI direct import mode Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -309,16 +309,18 @@ export async function handleWriteCommand(
|
||||
|
||||
case 'cookie-import-browser': {
|
||||
// Two modes:
|
||||
// 1. Direct CLI import: cookie-import-browser <browser> --domain <domain>
|
||||
// 1. Direct CLI import: cookie-import-browser <browser> --domain <domain> [--profile <profile>]
|
||||
// 2. Open picker UI: cookie-import-browser [browser]
|
||||
const browserArg = args[0];
|
||||
const domainIdx = args.indexOf('--domain');
|
||||
const profileIdx = args.indexOf('--profile');
|
||||
const profile = (profileIdx !== -1 && profileIdx + 1 < args.length) ? args[profileIdx + 1] : 'Default';
|
||||
|
||||
if (domainIdx !== -1 && domainIdx + 1 < args.length) {
|
||||
// Direct import mode — no UI
|
||||
const domain = args[domainIdx + 1];
|
||||
const browser = browserArg || 'comet';
|
||||
const result = await importCookies(browser, [domain]);
|
||||
const result = await importCookies(browser, [domain], profile);
|
||||
if (result.cookies.length > 0) {
|
||||
await page.context().addCookies(result.cookies);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user