feat: add chrome_args configuration for custom Chrome flags#47
Merged
feat: add chrome_args configuration for custom Chrome flags#47
Conversation
Running Chrome in Docker containers or CI environments requires additional flags to work properly. This commit adds --no-sandbox and --disable-setuid-sandbox flags when CI environment variable is detected. Changes: - Add --no-sandbox flag in CI environments - Add --disable-setuid-sandbox flag in CI environments These flags are essential for running Chrome in containerized environments where sandboxing may not work properly. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.toml: 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>
ff35039 to
81cd6e0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
chrome_argsconfiguration 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-sandboxto work properly.Problem
Previously, Chrome flags for CI/Docker environments (
--no-sandbox,--disable-setuid-sandbox) were only automatically added when theCIenvironment variable was set. This didn't work for devcontainer environments which don't haveCI=trueset.Solution
Add a
chrome_argsconfiguration option that allows users to specify custom Chrome flags in their config file:Changes
src/core/config.rs): Addchrome_argsfield (Vec)src/core/cdp/browser.rs): Accept and apply chrome_argssrc/core/patent_search.rs): Pass chrome_args to BrowserManagersrc/cli/mod.rs): Pass chrome_args from config to PatentSearchersrc/mcp/mod.rs): Pass chrome_args from config to PatentSearcherConfiguration Example
CI Environment
When
CI=trueis set, the following flags are automatically added:--disable-gpu--no-sandbox--disable-setuid-sandboxTest plan
🤖 Generated with Claude Code