Skip to content

feat: add Microsoft Edge browser support#6

Open
freebattle wants to merge 1 commit into
aeroxy:mainfrom
freebattle:main
Open

feat: add Microsoft Edge browser support#6
freebattle wants to merge 1 commit into
aeroxy:mainfrom
freebattle:main

Conversation

@freebattle

@freebattle freebattle commented Jun 4, 2026

Copy link
Copy Markdown

Summary by CodeRabbit

  • New Features

    • Added support for Microsoft Edge browser alongside Chrome.
    • Introduced --channel edge option with variants (edge-beta, edge-canary, edge-dev) for targeting Edge instances.
  • Documentation

    • Updated setup and configuration instructions to include Edge enablement steps.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR extends chrome-devtools-cli to support Edge browsers alongside Chrome. CLI arguments, browser resolution logic, and documentation are updated to recognize Edge channels (edge, edge-beta, edge-canary, edge-dev), resolve Edge user-data directories on all platforms, and describe the expanded daemon architecture for multi-browser connectivity.

Changes

Chrome and Edge Browser Support Expansion

Layer / File(s) Summary
CLI Channel Documentation and Public API
src/lib.rs, README.md
CLI channel argument documentation is expanded to enumerate Edge variants alongside Chrome variants, and the top-level README description and global --channel option text are broadened to reflect Chrome or Edge support.
Skill Definition and Prerequisites
skill/chrome-devtools/SKILL.md
Skill metadata description and prerequisites now cover both Chrome and Edge remote debugging configuration, including Edge-specific CLI setup via --channel edge with an example command.
Browser Channel Resolution and User-Data Mapping
src/browser.rs
User-data directory mappings are extended to include Edge channels on macOS, Linux, and Windows; error messages are updated to reference "browser" instead of "Chrome"; and validation for unknown channels is expanded to list the full Chrome+Edge channel set.
Architecture and Daemon Behavior Documentation
README.md
Architecture diagram and prerequisites sections are updated to describe daemon IPC behavior connecting to Chrome or Edge DevTools WebSocket, with platform-specific IPC/TCP details and revised socket/PID file documentation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A browser walks into a CLI
One Chrome, one Edge, now unified!
Channels bend to both their names,
Sockets found, WebSockets tamed.
Cross-platform paths align with grace, 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add Microsoft Edge browser support' directly and clearly describes the main objective of the changeset—extending the tool to support Microsoft Edge in addition to Chrome across all relevant components (README, documentation, and source code).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for Microsoft Edge browser channels (edge, edge-beta, edge-canary, edge-dev) across macOS, Linux, and Windows, updating the documentation, CLI help text, and user data directory resolution logic accordingly. It also documents Windows daemon details (TCP localhost IPC). The review feedback suggests converting the channel string to lowercase before matching to ensure case-insensitive channel selection.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/browser.rs
Comment on lines 68 to 72
fn default_chrome_user_data_dir(channel: &str) -> Result<PathBuf> {
#[cfg(target_os = "macos")]
{
let home = dirs::home_dir().ok_or_else(|| anyhow!("Cannot determine home directory"))?;
let base = home.join("Library/Application Support/Google");
let dir = match channel {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The channel parameter is matched against exact lowercase string literals (e.g., "edge", "stable"). If a user passes a channel with different casing (e.g., --channel Edge or --channel Stable), the match will fail with an Unknown browser channel error. Converting the channel string to lowercase before matching makes the CLI more robust and user-friendly.

Suggested change
fn default_chrome_user_data_dir(channel: &str) -> Result<PathBuf> {
#[cfg(target_os = "macos")]
{
let home = dirs::home_dir().ok_or_else(|| anyhow!("Cannot determine home directory"))?;
let base = home.join("Library/Application Support/Google");
let dir = match channel {
fn default_chrome_user_data_dir(channel: &str) -> Result<PathBuf> {
let channel_lower = channel.to_lowercase();
let channel = channel_lower.as_str();
#[cfg(target_os = "macos")]
{
let home = dirs::home_dir().ok_or_else(|| anyhow!("Cannot determine home directory"))?;
let dir = match channel {

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 181-183: Update the README to stop hardcoding `/tmp` for Unix temp
paths and instead state that IPC socket and PID file are placed in the system
temporary directory (the implementation uses std::env::temp_dir() in
src/protocol.rs), e.g. "system temp directory (returned by
std::env::temp_dir())" for Unix, while keeping the Windows %TEMP% references;
adjust the two bullets for IPC (macOS/Linux) and PID file (Unix) to reflect
"system temp-dir" rather than `/tmp`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 424fa9c6-8a81-4340-87f4-855c218881e5

📥 Commits

Reviewing files that changed from the base of the PR and between fce2afc and e53ce8f.

📒 Files selected for processing (4)
  • README.md
  • skill/chrome-devtools/SKILL.md
  • src/browser.rs
  • src/lib.rs

Comment thread README.md
Comment on lines +181 to +183
- **IPC (macOS/Linux)**: Unix socket at `/tmp/chrome-devtools-daemon.sock`
- **IPC (Windows)**: TCP on `127.0.0.1` with address stored in `%TEMP%\chrome-devtools-daemon.addr`
- **PID file**: `/tmp/chrome-devtools-daemon.pid` (Unix) or `%TEMP%\chrome-devtools-daemon.pid` (Windows)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Daemon path docs should not hardcode /tmp on Unix.

The implementation uses std::env::temp_dir() (src/protocol.rs), so Unix paths are not guaranteed to be /tmp/.... Please document these as system temp-dir paths to avoid debugging confusion.

Suggested doc patch
-- **IPC (macOS/Linux)**: Unix socket at `/tmp/chrome-devtools-daemon.sock`
-- **PID file**: `/tmp/chrome-devtools-daemon.pid` (Unix) or `%TEMP%\chrome-devtools-daemon.pid` (Windows)
+- **IPC (macOS/Linux)**: Unix socket in the system temp directory (e.g. `/tmp/chrome-devtools-daemon.sock`)
+- **PID file**: In the system temp directory (e.g. `/tmp/chrome-devtools-daemon.pid` on many Unix systems) or `%TEMP%\chrome-devtools-daemon.pid` (Windows)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **IPC (macOS/Linux)**: Unix socket at `/tmp/chrome-devtools-daemon.sock`
- **IPC (Windows)**: TCP on `127.0.0.1` with address stored in `%TEMP%\chrome-devtools-daemon.addr`
- **PID file**: `/tmp/chrome-devtools-daemon.pid` (Unix) or `%TEMP%\chrome-devtools-daemon.pid` (Windows)
- **IPC (macOS/Linux)**: Unix socket in the system temp directory (e.g. `/tmp/chrome-devtools-daemon.sock`)
- **IPC (Windows)**: TCP on `127.0.0.1` with address stored in `%TEMP%\chrome-devtools-daemon.addr`
- **PID file**: In the system temp directory (e.g. `/tmp/chrome-devtools-daemon.pid` on many Unix systems) or `%TEMP%\chrome-devtools-daemon.pid` (Windows)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 181 - 183, Update the README to stop hardcoding
`/tmp` for Unix temp paths and instead state that IPC socket and PID file are
placed in the system temporary directory (the implementation uses
std::env::temp_dir() in src/protocol.rs), e.g. "system temp directory (returned
by std::env::temp_dir())" for Unix, while keeping the Windows %TEMP% references;
adjust the two bullets for IPC (macOS/Linux) and PID file (Unix) to reflect
"system temp-dir" rather than `/tmp`.

@aeroxy

aeroxy commented Jun 5, 2026

Copy link
Copy Markdown
Owner

@freebattle would u like to address the reviews from gemini and code rabbit above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants