Skip to content

Commit 38c23a0

Browse files
committed
Make chromium startup a little more reliable
1 parent bac7bbf commit 38c23a0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/interceptors/chromium-based-interceptors.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ abstract class ChromiumBasedInterceptor implements Interceptor {
7474
await hideWarningServer.stop();
7575

7676
this.activeBrowsers[proxyPort] = browser;
77-
browser.process.once('close', () => {
77+
browser.process.once('close', async () => {
7878
delete this.activeBrowsers[proxyPort];
7979

8080
// Opera has a launch proc that exits immediately in Windows, so we can't clear the profile there.
8181
if (process.platform === 'win32' && this.variantName === 'opera') return;
82+
await delay(1000); // No hurry, make sure the browser & related processes have all cleaned up
8283

8384
if (Object.keys(this.activeBrowsers).length === 0 && browserDetails && _.isString(browserDetails.profile)) {
8485
// If we were the last browser, and we have a profile path, and it's in our config

0 commit comments

Comments
 (0)