From 1e9fecaf60fb8c50f37d5c0fb26e45d1d9fafa88 Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Wed, 25 Feb 2026 17:26:21 +0100 Subject: [PATCH] add --profile-directory=Default to Chrome restart commands Prevents Chrome from hanging on the profile picker when agents restart it programmatically. Applied to: - getChromeRestartCommand() in screen-recording.ts (used for recording setup) - All Chrome startup examples in skill.md (basic + recording flags) - Both macOS, Linux, and Windows variants --- playwriter/src/screen-recording.ts | 5 +++-- playwriter/src/skill.md | 14 +++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/playwriter/src/screen-recording.ts b/playwriter/src/screen-recording.ts index e5f35c0..3a3da2f 100644 --- a/playwriter/src/screen-recording.ts +++ b/playwriter/src/screen-recording.ts @@ -27,8 +27,9 @@ import { EXTENSION_IDS } from './utils.js' */ export function getChromeRestartCommand(): string { const platform = os.platform() - const flags = - EXTENSION_IDS.map((id) => `--allowlisted-extension-id=${id}`).join(' ') + ' --auto-accept-this-tab-capture' + const extensionFlags = EXTENSION_IDS.map((id) => `--allowlisted-extension-id=${id}`).join(' ') + // --profile-directory=Default skips the profile picker on startup, preventing Chrome from hanging + const flags = `${extensionFlags} --auto-accept-this-tab-capture --profile-directory=Default` if (platform === 'darwin') { return `osascript -e 'quit app "Google Chrome"' && sleep 1 && open -a "Google Chrome" --args ${flags}` diff --git a/playwriter/src/skill.md b/playwriter/src/skill.md index 39fa017..6a61437 100644 --- a/playwriter/src/skill.md +++ b/playwriter/src/skill.md @@ -126,29 +126,29 @@ Control user's Chrome browser via playwright code snippets. Prefer single-line c ```bash # macOS -open -a "Google Chrome" +open -a "Google Chrome" --args --profile-directory=Default # Linux -google-chrome & +google-chrome --profile-directory=Default & # Windows (cmd) -start chrome.exe +start chrome.exe --profile-directory=Default # Windows (PowerShell) -Start-Process chrome.exe +Start-Process chrome.exe -ArgumentList '--profile-directory=Default' ``` To also enable automatic tab capture for screen recording (no manual extension click needed), add the `--allowlisted-extension-id` and `--auto-accept-this-tab-capture` flags: ```bash # macOS -open -a "Google Chrome" --args --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe --auto-accept-this-tab-capture +open -a "Google Chrome" --args --profile-directory=Default --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe --auto-accept-this-tab-capture # Linux -google-chrome --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe --auto-accept-this-tab-capture & +google-chrome --profile-directory=Default --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe --auto-accept-this-tab-capture & # Windows -start chrome.exe --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe --auto-accept-this-tab-capture +start chrome.exe --profile-directory=Default --allowlisted-extension-id=jfeammnjpkecdekppnclgkkffahnhfhe --auto-accept-this-tab-capture ``` You can collaborate with the user - they can help with captchas, difficult elements, or reproducing bugs.