/claim #852 This PR adds anti-fingerprinting capabilities to the browser-use library to help avoid bot detection mechanisms like those used by Cloudflare and DataDome. The implementation uses the patchright library, which is a patched version of playwright that includes anti-fingerprinting features.
Changes Added anti_fingerprint flag to BrowserConfig (default: False) Replaced playwright imports with patchright imports across the codebase Modified the browser launch method to use Chrome as the channel when anti-fingerprinting is enabled Updated the context creation to handle the anti-fingerprinting settings Added patchright as a dependency in pyproject.toml Created example files demonstrating the anti-fingerprinting capabilities Updated documentation to explain the anti-fingerprinting flag Added patchright to the silenced loggers in logging_config.py Usage Users can enable anti-fingerprinting by setting anti_fingerprint=True in their BrowserConfig:
browser = Browser(
config=BrowserConfig(
headless=False,
anti_fingerprint=True
)
)
Testing Created example scripts to demonstrate and test the anti-fingerprinting capabilities Tested against bot detection mechanisms and observed significant improvement in avoiding detection Verified that the implementation works correctly with the existing codebase Examples Added several example scripts in the examples/browser directory:
anti_fingerprint.py - Basic example of using anti-fingerprinting anti_fingerprint_comparison.py - Comparison of browsers with and without anti-fingerprinting anti_fingerprint_example.py - Real-world example of using anti-fingerprinting test_anti_fingerprint.py - Test script for anti-fingerprinting verify_anti_fingerprint.py - Verification script for anti-fingerprinting Documentation Updated the documentation in docs/customize/agent-settings.mdx to explain the anti-fingerprinting flag and provide usage examples.
The implementation is complete and ready for review. The anti-fingerprinting capabilities work correctly and provide a significant improvement in avoiding bot detection.
/fixed #852
Kunal Darekar
@Kunal-Darekar
Browser Use (YC W25)
@browser-use
the.bishop
@bishopBethel