chore: document user-data-dir

This commit is contained in:
Pavel Feldman 2025-03-26 16:03:46 -07:00
parent 7a87e160ad
commit 3ca4c9851d
2 changed files with 13 additions and 1 deletions

View File

@ -59,6 +59,18 @@ code-insiders --add-mcp '{"name":"playwright","command":"npx","args":["@playwrig
After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
### User data directory
Playwright MCP will launch Chrome browser with the new profile, located at
```
- `%USERPROFILE%\AppData\Local\ms-playwright\mcp-chrome-profile` on Windows
- `~/Library/Caches/ms-playwright/mcp-chrome-profile` on macOS
- `~/.cache/ms-playwright/mcp-chrome-profile` on Linux
```
All the logged in information will be stored in that profile, you can delete it between sessions if you'dlike to clear the offline state.
### Running headless browser (Browser without GUI).

View File

@ -69,7 +69,7 @@ async function userDataDir() {
cacheDirectory = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');
else
throw new Error('Unsupported platform: ' + process.platform);
const result = path.join(cacheDirectory, 'ms-playwright', 'mcp-chromium-profile');
const result = path.join(cacheDirectory, 'ms-playwright', 'mcp-chrome-profile');
await fs.promises.mkdir(result, { recursive: true });
return result;
}