Skip to content

Commit de25a12

Browse files
committed
Open amiusing in the 'existing' window for existing-chrom*
Without this, it opens in a fresh window, due to how the browser is launched on Mac: passing a URI to 'open'.
1 parent 0a8f760 commit de25a12

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/interceptors/chromium-based-interceptors.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,15 @@ abstract class ExistingChromiumBasedInterceptor implements Interceptor {
246246
launchOptions.options.push(
247247
'--no-default-browser-check',
248248
'--no-first-run',
249-
'--disable-popup-blocking' // Required for hide-warning -> amiusing hop
249+
'--disable-popup-blocking', // Required for hide-warning -> amiusing hop
250+
// If we killed something, use --restore-last-session to ensure it comes back:
251+
...(existingPid ? ['--restore-last-session'] : []),
252+
// Passing the URL here instead of passing it to launchBrowser ensures that it isn't
253+
// opened in a separate window when launching on Mac
254+
hideWarningServer.hideWarningUrl
250255
);
251256

252-
// If we killed something, use --restore-last-session to ensure it comes back:
253-
if (existingPid) launchOptions.options.push('--restore-last-session');
254-
255-
const browser = await launchBrowser(hideWarningServer.hideWarningUrl, {
257+
const browser = await launchBrowser("", {
256258
...launchOptions,
257259
skipDefaults: true,
258260
profile: null // Enforce that we use the default profile

0 commit comments

Comments
 (0)