Skip to content

feat(browser): add system browser detection for Playwright #336

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 21, 2025

Conversation

bhouston
Copy link
Member

Description

This PR adds system browser detection for Playwright integration in mycoder. It allows mycoder to detect and use system-installed browsers instead of requiring Playwright's bundled browsers to be installed separately. This is particularly useful when mycoder is installed globally via npm.

Changes

  • Add BrowserDetector module for cross-platform browser detection (Windows, macOS, Linux)
  • Update SessionManager to use detected system browsers via Playwright's executablePath option
  • Add configuration options in mycoder.config.js for browser preferences
  • Update documentation in README.md with information about the browser detection feature
  • Maintain compatibility with headless mode and clean sessions

Testing

The implementation has been tested with:

  • Browser detection on macOS
  • Proper fallback to Playwright's bundled browsers when no system browser is found
  • Integration with existing tests (all tests pass)

Related Issues

Fixes #333

Additional Notes

The implementation prioritizes Chrome/Chromium browsers as they have the best compatibility with Playwright, followed by Firefox. The browser detection is done at startup and cached for subsequent browser sessions.

semantic-release-bot and others added 3 commits March 20, 2025 19:00
# [mycoder-agent-v1.5.0](mycoder-agent-v1.4.2...mycoder-agent-v1.5.0) (2025-03-20)

### Bug Fixes

* improve resource trackers and fix tests ([c31546e](c31546e))
* properly format agentDone tool completion message ([8d19c41](8d19c41))
* resolve build and test issues ([549f0c7](549f0c7))
* resolve TypeError in interactive mode ([6e5e191](6e5e191))
* restore visibility of tool execution output ([0809694](0809694)), closes [#328](#328)
* shell message should reset output on each read ([670a10b](670a10b))
* update CLI cleanup to use ShellTracker instead of processStates ([3dca767](3dca767))

### Features

* add colored console output for agent logs ([5f38b2d](5f38b2d))
* Add interactive correction feature to CLI mode ([de2861f](de2861f)), closes [#326](#326)
* add parent-to-subagent communication in agentMessage tool ([3b11db1](3b11db1))
* add stdinContent parameter to shell commands ([5342a0f](5342a0f)), closes [#301](#301)
* implement ShellTracker to decouple from backgroundTools ([65378e3](65378e3))
* remove respawn capability, it wasn't being used anyhow. ([8e086b4](8e086b4))
# [mycoder-v1.5.0](mycoder-v1.4.1...mycoder-v1.5.0) (2025-03-20)

### Bug Fixes

* list default model correctly in logging ([5b67b58](5b67b58))
* restore visibility of tool execution output ([0809694](0809694)), closes [#328](#328)
* update CLI cleanup to use ShellTracker instead of processStates ([3dca767](3dca767))

### Features

* Add interactive correction feature to CLI mode ([de2861f](de2861f)), closes [#326](#326)
* add stdinContent parameter to shell commands ([5342a0f](5342a0f)), closes [#301](#301)
This change allows mycoder to detect and use system-installed browsers
instead of requiring Playwright's bundled browsers to be installed.
It improves the experience when mycoder is installed globally via npm.

- Add BrowserDetector module for cross-platform browser detection
- Update SessionManager to use detected system browsers
- Add configuration options for browser preferences
- Update documentation in README.md
- Maintain compatibility with headless mode and clean sessions

Fixes #333
@bhouston bhouston merged commit e319645 into main Mar 21, 2025
1 check passed
Copy link

🎉 This PR is included in version mycoder-agent-v1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version mycoder-v1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

bhouston added a commit that referenced this pull request Mar 21, 2025
This commit adds documentation for the system browser detection feature introduced in PR #336 and issue #333. It includes:\n\n- New browser-detection.md page with comprehensive information\n- Updates to configuration.md to document new options\n- Updates to getting started guides for all platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browsers via playwright need to be manually installed.
2 participants