Skip to content

Commit 0ffed21

Browse files
committed
Existing Chrome launches should not kill fresh Chromes
This is bad because it's an unrelated window that we shouldn't kill, clearly, but also because it means we don't kill the real existing Chrome window, if present, which will stop the real launch from working successfully.
1 parent fee1f1e commit 0ffed21

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/interceptors/chromium-based-interceptors.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,20 @@ abstract class ExistingChromiumBasedInterceptor implements Interceptor {
195195
}
196196
});
197197

198-
const rootProcess = browserProcesses.find(({ args }) =>
198+
const defaultRootProcess = browserProcesses.find(({ args }) =>
199+
args !== undefined &&
199200
// Find the main process, skipping any renderer/util processes
200-
args !== undefined && !args.includes('--type=')
201+
!args.includes('--type=') &&
202+
// Also skip any non-default profile processes (e.g. our own fresh Chromes)
203+
!args.includes('--user-data-dir')
201204
);
202205

203-
return rootProcess && rootProcess.pid;
206+
return defaultRootProcess && defaultRootProcess.pid;
204207
}
205208

206209
async activate(proxyPort: number, options: { closeConfirmed: boolean } = { closeConfirmed: false }) {
207210
if (!this.isActivable()) return;
208211

209-
const certificatePem = await readFile(this.config.https.certPath, 'utf8');
210-
const spkiFingerprint = generateSPKIFingerprint(certificatePem);
211-
212212
const hideWarningServer = new HideWarningServer(this.config);
213213
await hideWarningServer.start('https://amiusing.httptoolkit.tech');
214214

0 commit comments

Comments
 (0)