fix: 修复一键打开渠道出现无关标签
This commit is contained in:
@@ -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 {}
|
||||
|
||||
@@ -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 = '';
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user