feat(web-automation): implement milestone M1 canonical codex migration

This commit is contained in:
Stefano Fiorini
2026-04-09 10:13:25 -05:00
parent e917387d4f
commit 99fe6eab4e
15 changed files with 910 additions and 706 deletions

View File

@@ -1,24 +1,25 @@
import { Camoufox } from 'camoufox-js';
import { launchPersistentContext } from 'cloakbrowser';
import { homedir } from 'os';
import { join } from 'path';
import { mkdirSync, existsSync } from 'fs';
async function test() {
const profilePath = join(homedir(), '.camoufox-profile');
const profilePath = join(homedir(), '.cloakbrowser-profile');
if (!existsSync(profilePath)) {
mkdirSync(profilePath, { recursive: true });
}
console.log('Profile path:', profilePath);
console.log('Launching with user_data_dir...');
console.log('Launching with persistent userDataDir...');
const browser = await Camoufox({
const browser = await launchPersistentContext({
headless: true,
user_data_dir: profilePath,
userDataDir: profilePath,
humanize: true,
});
console.log('Browser launched');
const page = await browser.newPage();
const page = browser.pages()[0] || await browser.newPage();
console.log('Page created');
await page.goto('https://example.com', { timeout: 30000 });