This commit is contained in:
949036910@qq.com
2026-06-03 21:43:46 +08:00
parent bbdee469fc
commit 7d65e3e602
4 changed files with 178 additions and 38 deletions

View File

@@ -24,12 +24,11 @@ globalThis.__nodejsMain = async function main(params) {
return { success: false, message: `不支持的平台: ${platform}` };
}
const page = await newLoginPage(platform, accountId, cookies);
await page.goto(targetUrl, { waitUntil: "domcontentloaded", timeout: 60000 });
try {
await page.bringToFront();
} catch {
/* ignore */
globalThis.__native?.emitProgress?.("正在打开浏览器…");
const page = await newLoginPage(platform, accountId, cookies, targetUrl);
const cur = page.url();
if (!cur || cur === "about:blank" || !cur.includes("://")) {
await page.goto(targetUrl, { waitUntil: "domcontentloaded", timeout: 60000 });
}
await detachLoginBrowser(platform, accountId);