Skip to content

Commit e319645

Browse files
authored
Merge pull request #336 from drivecore/feature/system-browser-detection
feat(browser): add system browser detection for Playwright
2 parents df2a713 + 00bd879 commit e319645

11 files changed

+1013
-30
lines changed

README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ export default {
8181
userSession: false,
8282
pageFilter: 'none', // 'simple', 'none', or 'readability'
8383

84+
// System browser detection settings
85+
browser: {
86+
// Whether to use system browsers or Playwright's bundled browsers
87+
useSystemBrowsers: true,
88+
89+
// Preferred browser type (chromium, firefox, webkit)
90+
preferredType: 'chromium',
91+
92+
// Custom browser executable path (overrides automatic detection)
93+
// executablePath: null, // e.g., '/path/to/chrome'
94+
},
95+
8496
// Model settings
8597
provider: 'anthropic',
8698
model: 'claude-3-7-sonnet-20250219',
@@ -209,6 +221,43 @@ MyCoder follows the [Conventional Commits](https://www.conventionalcommits.org/)
209221

210222
For more details, see the [Contributing Guide](CONTRIBUTING.md).
211223

224+
## Browser Automation
225+
226+
MyCoder uses Playwright for browser automation, which is used by the `sessionStart` and `sessionMessage` tools. By default, Playwright requires browsers to be installed separately via `npx playwright install`.
227+
228+
### System Browser Detection
229+
230+
MyCoder now includes a system browser detection feature that allows it to use your existing installed browsers instead of requiring separate Playwright browser installations. This is particularly useful when MyCoder is installed globally.
231+
232+
The system browser detection:
233+
234+
1. Automatically detects installed browsers on Windows, macOS, and Linux
235+
2. Supports Chrome, Edge, Firefox, and other browsers
236+
3. Maintains headless mode and clean session capabilities
237+
4. Falls back to Playwright's bundled browsers if no system browser is found
238+
239+
### Configuration
240+
241+
You can configure the browser detection in your `mycoder.config.js`:
242+
243+
```js
244+
export default {
245+
// Other configuration...
246+
247+
// System browser detection settings
248+
browser: {
249+
// Whether to use system browsers or Playwright's bundled browsers
250+
useSystemBrowsers: true,
251+
252+
// Preferred browser type (chromium, firefox, webkit)
253+
preferredType: 'chromium',
254+
255+
// Custom browser executable path (overrides automatic detection)
256+
// executablePath: null, // e.g., '/path/to/chrome'
257+
},
258+
};
259+
```
260+
212261
## Contributing
213262

214263
Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to this project.

0 commit comments

Comments
 (0)