v0.4.1: Chrome cookie import, config.json, session persistence
- Add Chrome cookie importer (macOS Keychain AES-128-CBC decryption) - Add ~/.config/browse/config.json (headless, fullscreen, stealth, preview defaults) - Add ~/.config/browse/session.json (auto-save/restore cookies + localStorage) - Auto-import from all browsers (Safari + Firefox + Chrome) on first launch - Deduplicate cookies across browsers (domain+name+path key) - Defaults: headed, fullscreen, stealth, preview all enabled - Fix BigInt overflow for Chrome timestamps (CAST to TEXT in SQL)
This commit is contained in:
Vendored
+24
@@ -3,6 +3,7 @@ import { resolve } from 'node:path';
|
||||
import { promisify } from 'node:util';
|
||||
import { webkit } from 'playwright';
|
||||
const execAsync = promisify(exec);
|
||||
import * as chrome from './chrome.js';
|
||||
import * as firefox from './firefox.js';
|
||||
import * as image from './image.js';
|
||||
import * as safari from './safari.js';
|
||||
@@ -866,6 +867,29 @@ export class ClaudeBrowser {
|
||||
domains,
|
||||
};
|
||||
}
|
||||
if (cmd.source === 'chrome') {
|
||||
const cookies = chrome.importChromeCookies({
|
||||
domain: cmd.domain,
|
||||
profile: cmd.profile,
|
||||
});
|
||||
if (cookies.length === 0) {
|
||||
return {
|
||||
ok: true,
|
||||
imported: 0,
|
||||
source: 'chrome',
|
||||
domains: [],
|
||||
};
|
||||
}
|
||||
const playwrightCookies = cookies.map(chrome.toPlaywrightCookie);
|
||||
await context.addCookies(playwrightCookies);
|
||||
const domains = [...new Set(cookies.map((c) => c.domain))];
|
||||
return {
|
||||
ok: true,
|
||||
imported: cookies.length,
|
||||
source: 'chrome',
|
||||
domains,
|
||||
};
|
||||
}
|
||||
return { ok: false, error: `Unknown import source: ${cmd.source}` };
|
||||
}
|
||||
async executeCommand(cmd) {
|
||||
|
||||
Reference in New Issue
Block a user