Skip to content

feat: add chrome_args configuration for custom Chrome flags#43

Merged
sonesuke merged 1 commit intomainfrom
feature/chrome-args-config
Feb 23, 2026
Merged

feat: add chrome_args configuration for custom Chrome flags#43
sonesuke merged 1 commit intomainfrom
feature/chrome-args-config

Conversation

@sonesuke
Copy link
Owner

Summary

Add chrome_args configuration option to allow users to specify custom Chrome/Chromium flags via config file. This is useful for Docker/devcontainer environments where Chrome requires additional flags like --no-sandbox to work properly.

Problem

Previously, Chrome flags for CI/Docker environments (--no-sandbox, --disable-setuid-sandbox) were only automatically added when the CI environment variable was set. This didn't work for devcontainer environments which don't have CI=true set.

Solution

Add a chrome_args configuration option that allows users to specify custom Chrome flags in their config file:

{
  "browser_path": "/usr/bin/google-chrome",
  "chrome_args": [
    "--no-sandbox",
    "--disable-setuid-sandbox",
    "--disable-gpu"
  ]
}

Changes

  • Config (src/core/config.rs): Add chrome_args field (Vec)
  • BrowserManager (src/core/cdp/browser.rs): Accept and apply chrome_args
  • README.md: Add documentation for chrome_args configuration

CI Environment

When CI=true is set, the following flags are automatically added:

  • --disable-gpu
  • --no-sandbox
  • --disable-setuid-sandbox

Test plan

  • Pre-commit checks pass (fmt, clippy, test)
  • Config parsing works with chrome_args
  • README documentation added

🤖 Generated with Claude Code

Add chrome_args configuration option to allow users to specify
custom Chrome/Chromium flags via config file. This is useful for
Docker/devcontainer environments where Chrome requires additional
flags like --no-sandbox to work properly.

Changes:
- Add chrome_args field to Config (Vec<String>)
- Pass chrome_args from Config to BrowserManager
- Apply custom Chrome args in get_browser method
- Update README.md with configuration documentation

Users can now configure Chrome flags in config.json:
  chrome_args = ["--no-sandbox", "--disable-setuid-sandbox"]

This provides flexibility while keeping CI environment auto-detection
(when CI=true is set, --no-sandbox is automatically added).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@sonesuke sonesuke mentioned this pull request Feb 23, 2026
@sonesuke sonesuke merged commit 404c340 into main Feb 23, 2026
4 checks passed
@sonesuke sonesuke deleted the feature/chrome-args-config branch February 23, 2026 06:33
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