11
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
const {
|
||||
newLoginPage,
|
||||
newLoginPageKeepOpen,
|
||||
detachLoginBrowser,
|
||||
bringPageToFront,
|
||||
LOGIN_URLS,
|
||||
} = require("./publish_browser.js");
|
||||
|
||||
@@ -25,11 +26,13 @@ globalThis.__nodejsMain = async function main(params) {
|
||||
}
|
||||
|
||||
globalThis.__native?.emitProgress?.("正在打开浏览器…");
|
||||
const page = await newLoginPage(platform, accountId, cookies, targetUrl);
|
||||
const page = await newLoginPageKeepOpen(platform, accountId, cookies, targetUrl);
|
||||
const cur = page.url();
|
||||
if (!cur || cur === "about:blank" || !cur.includes("://")) {
|
||||
await page.goto(targetUrl, { waitUntil: "domcontentloaded", timeout: 60000 });
|
||||
}
|
||||
await bringPageToFront(page);
|
||||
// 断开 Puppeteer,保留 detached Chrome 窗口(Node 退出后不关浏览器)
|
||||
await detachLoginBrowser(platform, accountId);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user