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:
Vendored
+7
-1
@@ -225,10 +225,16 @@ export function toPlaywrightCookie(cookie) {
|
||||
if (expires <= 0) {
|
||||
expires = -1;
|
||||
}
|
||||
// Normalize domain: Firefox sometimes stores ".www.example.com" which Playwright
|
||||
// won't match for "www.example.com". Strip ".www." prefix to ".example.com".
|
||||
let domain = cookie.domain;
|
||||
if (domain.startsWith('.www.')) {
|
||||
domain = domain.slice(4); // ".www.example.com" -> ".example.com"
|
||||
}
|
||||
return {
|
||||
name: cookie.name,
|
||||
value: cookie.value,
|
||||
domain: cookie.domain,
|
||||
domain,
|
||||
path: cookie.path,
|
||||
expires,
|
||||
secure: cookie.secure,
|
||||
|
||||
Reference in New Issue
Block a user