We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d2573f5 commit 100c665Copy full SHA for 100c665
src/interceptors/chromium-based-interceptors.ts
@@ -283,6 +283,16 @@ abstract class ExistingChromiumBasedInterceptor implements Interceptor {
283
async deactivate(proxyPort: number | string) {
284
if (this.isActive(proxyPort)) {
285
const { browser } = this.activeBrowser!;
286
+
287
+ if (process.platform === 'win32') {
288
+ // Try to cleanly close if we can, rather than killing Chrome directly:
289
+ try {
290
+ await windowsClose(browser!.pid)
291
+ .then(() => waitForExit(browser!.pid));
292
+ return;
293
+ } catch (e) {} // If this fails/times out, kill like we do elsewhere:
294
+ }
295
296
const exitPromise = new Promise((resolve) => browser!.process.once('close', resolve));
297
browser!.stop();
298
await exitPromise;
0 commit comments