[Feature Request]: Expose full Playwright launch and context parameters in BrowserConfig #1820
Melodeiro
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What needs to be done?
Expose standard Playwright
chromium.launch()andbrowser.new_context()parameters that are currently not accessible throughBrowserConfig:executable_path— path to a custom Chromium binaryignore_default_args— list of default Chromium flags to exclude from launch--disable-gpu,--disable-gpu-compositing) that_build_browser_args()always includessetup_context()always setsUser-Agentandsec-ch-uaviaset_extra_http_headers, overriding whatever the browser natively reportsnavigator_overrider.jsinjection independently ofoverride_navigatorwhen the binary already handles these properties nativelydevice_scale_factor— currently hardcoded to1.0increate_browser_context()What problem does this solve?
Custom Chromium builds (ungoogled-chromium, Brave, stealth-patched binaries, etc.) manage their own fingerprinting at the C++ level — user agent, WebGL renderer, device scale factor, navigator properties, and so on. When Crawl4AI overrides these values at the Playwright layer, it creates detectable mismatches:
navigator.webdriver = undefinedat the engine level, butnavigator_overrider.jsre-patches it viaObject.defineProperty— which anti-bot systems detect throughtoString()andgetOwnPropertyDescriptor()--disable-gpuprevents hardware-accelerated WebGL, which changes the rendering fingerprint the binary was designed to producedevice_scale_factor: 1.0may conflict with what the binary reports viawindow.devicePixelRatioThe net effect is that the browser's built-in stealth gets partially undone by the crawler layer on top of it.
Target users/beneficiaries
Anyone using Crawl4AI with a custom Chromium binary — whether for anti-detection, testing, or enterprise browser builds — where the binary manages its own configuration and the crawler should not override it.
Current alternatives/workarounds
There is no clean workaround within the public API. The hardcoded args in
_build_browser_args(), the forcedUser-Agent/sec-ch-uaheaders insetup_context(), and thedevice_scale_factorincreate_browser_context()are not configurable. The only option is to fork or monkey-patchBrowserManager.Proposed approach
One possible approach (open to other ideas):
executable_path: str = Noneandignore_default_args: list = NonetoBrowserConfig, pass them through tochromium.launch()skip_default_browser_args: bool = Falsethat, when set, skips the hardcoded args list in_build_browser_args()and only usesextra_argsskip_default_headers: bool = Falseto skip the forcedUser-Agent/sec-ch-uaoverride insetup_context()device_scale_factora configurable field inBrowserConfiginstead of hardcoded1.0This keeps full backward compatibility — all defaults stay the same — while giving users of custom binaries full control when they need it.
Beta Was this translation helpful? Give feedback.
All reactions