Skip to content

Commit 82eba4d

Browse files
Add extension setting for chromium executable path (RooCodeInc#1721)
* Add extension setting for chromium executable path * apply changeset * Update src/services/browser/BrowserSession.ts Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * format code --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent 9812dd4 commit 82eba4d

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.changeset/poor-cobras-destroy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": minor
3+
---
4+
5+
Add extension setting for chromium executable path

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@
171171
],
172172
"default": "medium",
173173
"description": "Controls the reasoning effort when using the o3-mini model. Higher values may result in more thorough but slower responses."
174+
},
175+
"cline.chromeExecutablePath": {
176+
"type": "string",
177+
"default": null,
178+
"description": "Path to Chrome executable for browser use functionality. If not set, the extension will attempt to find or download it automatically."
174179
}
175180
}
176181
}

src/services/browser/BrowserSession.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ export class BrowserSession {
4242
await fs.mkdir(puppeteerDir, { recursive: true })
4343
}
4444

45-
// if chromium doesn't exist, this will download it to path.join(puppeteerDir, ".chromium-browser-snapshots")
46-
// if it does exist it will return the path to existing chromium
47-
const stats: PCRStats = await PCR({
48-
downloadPath: puppeteerDir,
49-
})
45+
const chromeExecutablePath = vscode.workspace.getConfiguration("cline").get<string>("chromeExecutablePath")
46+
if (chromeExecutablePath && !(await fileExistsAtPath(chromeExecutablePath)))
47+
throw new Error(`Chrome executable not found at path: ${chromeExecutablePath}`)
48+
const stats: PCRStats = chromeExecutablePath
49+
? { puppeteer: require("puppeteer-core"), executablePath: chromeExecutablePath }
50+
: // if chromium doesn't exist, this will download it to path.join(puppeteerDir, ".chromium-browser-snapshots")
51+
// if it does exist it will return the path to existing chromium
52+
await PCR({ downloadPath: puppeteerDir })
5053

5154
return stats
5255
}

0 commit comments

Comments
 (0)