exit child process while parent process has exited - tip: to make disconnect event being trigger, a ipc channel must be established between parent and child event

This commit is contained in:
geekgeekrun
2024-02-23 10:02:16 +08:00
parent 2c73660625
commit c97ca5f585
4 changed files with 23 additions and 8 deletions
@@ -307,11 +307,15 @@ export async function mainLoop (hooks) {
// ;await browser.close()
} catch (err) {
browser.close()
browse = null
page = null
closeBrowserWindow()
console.error(err)
throw err
}
}
export async function closeBrowserWindow () {
browser?.close()
browse = null
page = null
}