diff --git a/README.md b/README.md index b06a151..4b86871 100644 --- a/README.md +++ b/README.md @@ -83,9 +83,9 @@ The Playwright MCP server supports the following command-line options: Playwright MCP will launch the browser with the new profile, located at ``` -- `%USERPROFILE%\AppData\Local\ms-playwright\mcp-chromium-profile` on Windows -- `~/Library/Caches/ms-playwright/mcp-chromium-profile` on macOS -- `~/.cache/ms-playwright/mcp-chromium-profile` on Linux +- `%USERPROFILE%\AppData\Local\ms-playwright\mcp-{channel}-profile` on Windows +- `~/Library/Caches/ms-playwright/mcp-{channel}-profile` on macOS +- `~/.cache/ms-playwright/mcp-{channel}-profile` on Linux ``` All the logged in information will be stored in that profile, you can delete it between sessions if you'd like to clear the offline state. diff --git a/src/config.ts b/src/config.ts index 8b302fd..4f62287 100644 --- a/src/config.ts +++ b/src/config.ts @@ -96,7 +96,7 @@ export async function configFromCLIOptions(cliOptions: CLIOptions): Promise { } } -async function createUserDataDir(browserName: 'chromium' | 'firefox' | 'webkit') { +async function createUserDataDir(options: { browserName: 'chromium' | 'firefox' | 'webkit', channel: string | undefined }) { let cacheDirectory: string; if (process.platform === 'linux') cacheDirectory = process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache'); @@ -141,7 +141,7 @@ async function createUserDataDir(browserName: 'chromium' | 'firefox' | 'webkit') 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-${browserName}-profile`); + const result = path.join(cacheDirectory, 'ms-playwright', `mcp-${options.channel ?? options.browserName}-profile`); await fs.promises.mkdir(result, { recursive: true }); return result; }