fix: worker 页面改用 domcontentloaded 避免 networkidle 超时

challenge 页面已获取 cookie,worker 页面无需等 networkidle。

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BaskDuan
2026-04-02 23:06:04 +08:00
parent e6e15c86d1
commit 6c56417a06

View File

@@ -72,10 +72,11 @@ async function initBrowser() {
challengeCount++;
// ---- Worker 页面:代理 API 请求 ----
// cookie 已在 challenge 页面获取worker 页面只需加载到 domcontentloaded 即可
workerPage = await context.newPage();
await workerPage.goto(CHALLENGE_URL, {
waitUntil: 'networkidle',
timeout: 30000,
waitUntil: 'domcontentloaded',
timeout: 60000,
});
// 注册流式回调Node.js 侧接收浏览器内 fetch 的数据块)