fix: 修复一键打开渠道出现无关标签

This commit is contained in:
DEV_DSW
2026-03-19 11:14:52 +08:00
parent c4a0e4f9a4
commit 8902e59c2a
5 changed files with 150 additions and 34 deletions

View File

@@ -109,7 +109,7 @@ const isBlankLikePage = (url) => {
const pagesAfter = await context.pages();
for (const p of pagesAfter) {
if (!usedPages.has(p) && isBlankLikePage(p.url())) {
if (!usedPages.has(p)) {
try {
await p.close();
} catch {}

View File

@@ -29,7 +29,6 @@ export class executeScriptService extends EventEmitter {
const child = spawn(process.execPath, [scriptPath], {
env: {
...process.env,
ELECTRON_RUN_AS_NODE: '1',
ROOM_TYPE: String(roomType),
START_DATE: String(startTime),
END_DATE: String(endTime),
@@ -38,6 +37,7 @@ export class executeScriptService extends EventEmitter {
CHANNELS: typeof channels === 'string' ? channels : JSON.stringify(channels),
START_TAB_INDEX: String(startTabIndex),
},
stdio: 'inherit'
});
let stdoutTail = '';

View File

@@ -33,7 +33,8 @@ export async function launchLocalChrome() {
'--window-position=0,0',
'--no-first-run',
`--user-data-dir=${profileDir}`,
'--no-default-browser-check'
'--no-default-browser-check',
'about:blank'
// '--window-maximized',
], {
detached: true,