diff --git a/.changeset/poor-cobras-destroy.md b/.changeset/poor-cobras-destroy.md new file mode 100644 index 0000000000..991c7324cc --- /dev/null +++ b/.changeset/poor-cobras-destroy.md @@ -0,0 +1,5 @@ +--- +"claude-dev": minor +--- + +Add extension setting for chromium executable path diff --git a/package.json b/package.json index 7276e45b8d..898e2b9edf 100644 --- a/package.json +++ b/package.json @@ -171,6 +171,11 @@ ], "default": "medium", "description": "Controls the reasoning effort when using the o3-mini model. Higher values may result in more thorough but slower responses." + }, + "cline.chromeExecutablePath": { + "type": "string", + "default": null, + "description": "Path to Chrome executable for browser use functionality. If not set, the extension will attempt to find or download it automatically." } } } diff --git a/src/services/browser/BrowserSession.ts b/src/services/browser/BrowserSession.ts index cbc7734d36..14b6ecef8b 100644 --- a/src/services/browser/BrowserSession.ts +++ b/src/services/browser/BrowserSession.ts @@ -42,11 +42,14 @@ export class BrowserSession { await fs.mkdir(puppeteerDir, { recursive: true }) } - // if chromium doesn't exist, this will download it to path.join(puppeteerDir, ".chromium-browser-snapshots") - // if it does exist it will return the path to existing chromium - const stats: PCRStats = await PCR({ - downloadPath: puppeteerDir, - }) + const chromeExecutablePath = vscode.workspace.getConfiguration("cline").get("chromeExecutablePath") + if (chromeExecutablePath && !(await fileExistsAtPath(chromeExecutablePath))) + throw new Error(`Chrome executable not found at path: ${chromeExecutablePath}`) + const stats: PCRStats = chromeExecutablePath + ? { puppeteer: require("puppeteer-core"), executablePath: chromeExecutablePath } + : // if chromium doesn't exist, this will download it to path.join(puppeteerDir, ".chromium-browser-snapshots") + // if it does exist it will return the path to existing chromium + await PCR({ downloadPath: puppeteerDir }) return stats }