Skip to content

fix(browser): make Chromium sandbox configurable - #2376

Open
deswanth12 wants to merge 1 commit into
unclecode:developfrom
deswanth12:fix/2371-chromium-sandbox
Open

deswanth12 wants to merge 1 commit into
unclecode:developfrom
deswanth12:fix/2371-chromium-sandbox

Conversation

@deswanth12

Copy link
Copy Markdown

Summary

Fixes #2371 by making Chromium sandbox behavior configurable and ensuring the sandbox setting is respected across browser launch paths.

Changes

  • Add BrowserConfig.chromium_sandbox for explicit programmatic configuration.
  • Support CRAWL4AI_CHROMIUM_SANDBOX=true as the environment-based fallback when the config is unspecified.
  • Remove --no-sandbox and pass Playwright's chromium_sandbox=True when sandboxing is enabled.
  • Apply the policy to regular and persistent browser launch paths.
  • Keep the setting outside the untrusted request configuration allowlist.
  • Add regression tests for defaults, environment fallback, explicit overrides, serialization/cloning, and untrusted configuration.

Validation

  • Sandbox regression tests: 6 passed.
  • Related browser and configuration tests: 36 passed.
  • Ruff checks: passed.
  • Git diff whitespace check: passed.

Runtime note: Linux/Docker sandbox operation still depends on compatible container and host security settings.

Fixes #2371

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.

1 participant