Fix networkidle timeouts and Firefox cookie domain normalization

- Replace networkidle with domcontentloaded + 5s race in goto, click,
  and session_restore — SPAs with persistent connections (LinkedIn,
  Gmail) never reach networkidle
- Normalize .www. cookie domains in Firefox importer — Playwright
  silently drops cookies with .www.example.com domains

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 13:26:53 +02:00
parent 5abc924ee7
commit c3eb4a0a92
11 changed files with 40 additions and 13 deletions
+4 -1
View File
@@ -665,7 +665,10 @@ server.tool(
// Navigate to saved URL
if (data.url) {
await page.goto(data.url, { waitUntil: 'networkidle' });
await page.goto(data.url, { waitUntil: 'domcontentloaded' });
await Promise.race([page.waitForLoadState('networkidle'), page.waitForTimeout(5000)]).catch(
() => {}
);
}
// Restore storage (runs in browser context)