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.