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
This commit is contained in:
Tommy D. Rossi
2026-02-25 17:26:21 +01:00
parent eb420dabff
commit 1e9fecaf60
2 changed files with 10 additions and 9 deletions
+3 -2
View File
@@ -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}`
+7 -7
View File
@@ -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.