launcher: move proc exit handler later

This commit is contained in:
CanadaHonk 2023-02-20 19:07:34 +00:00
parent 9a0f8eae6f
commit 86b7bfc14a

View File

@ -72,11 +72,6 @@ export default async (CDP, proc, injectionType = 'browser', { dataPath, browserN
}
});
// when the process has exited (all windows closed), clean up window internally
proc.on('exit', () => {
Window.close();
});
const browserInfo = await CDP.sendMessage('Browser.getVersion');
log('browser:', browserInfo.product);
@ -213,6 +208,11 @@ export default async (CDP, proc, injectionType = 'browser', { dataPath, browserN
versions
};
// when the process has exited (all windows closed), clean up window internally
proc.on('exit', () => {
Window.close();
});
// Close window fully internally if browser process closes
proc.on('close', Window.close);