Skip to content

use camoufox for bot evasion#805

Closed
iloveitaly wants to merge 1 commit intobrowser-use:mainfrom
iloveitaly:camoufox
Closed

use camoufox for bot evasion#805
iloveitaly wants to merge 1 commit intobrowser-use:mainfrom
iloveitaly:camoufox

Conversation

@iloveitaly
Copy link
Copy Markdown
Contributor

The existing bot evasion doesn't work at all. This is slightly better:

https://github.com/tinyfish-io/tf-playwright-stealth

But still fails on many sites. Camoufox is a impressive piece of engineering and
it looks to be compatible with the playwright API.

I just got this working, so before putting more effort I want to kick the tires and see what breaks.
Wanted to post this here in case others were running into issues as well.

@gaurav-cointab
Copy link
Copy Markdown

gaurav-cointab commented Feb 27, 2025

Hi is it working and is it better at bot detection evasion? @iloveitaly

because I tried with the changes in your PR, there was not much significant change, the session was still classified as bot.

Please update the PR with more changes if you have been able to make it work.

@iloveitaly
Copy link
Copy Markdown
Contributor Author

@gaurav-cointab use https://camoufox.com/ instead. This is working for me, at least better than the stealth plugins.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Comment on lines +267 to +269
# camofoux
if True:
return await browser.new_context()
Copy link
Copy Markdown
Contributor

@pirate pirate Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# camofoux
if True:
return await browser.new_context()

Returning a stock camoufox browser without the extra config params below would break a bunch of behavioral stuff, they're not just there for stealth.

Comment on lines +21 to +22
CAMOUFOX = True

Copy link
Copy Markdown
Contributor

@pirate pirate Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CAMOUFOX = True
CAMOUFOX = True

this should definbitely be an env var instead of hardcoded.
Switching the entire to project to Firefox instead of chromium is a massive change to just force everyone into.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, totally, i just threw this up quickly to show others where the entrypoints were

if there's interest in merging this in for real i will put more effort into it

Copy link
Copy Markdown
Contributor

@pirate pirate Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok no worries. Support for non-chromium browsers did just get merged recently #950, so there may be some interest in this again. just needs to be added here browser/browser.py:_setup_standard_browser

@pirate
Copy link
Copy Markdown
Contributor

pirate commented Apr 16, 2025

I think we're going to focus all our effort on patchright right now via #857. While I'd love to support more browsers, in practice it adds a lot more surface area for things to break subtly and I think patchright will get us most of the way there if the real goal is just to avoid bot detection.

If you feel really strongly that this is mistake / if you think camoufox can beat patchright feel free to comment back here and we can continue the discussion. thanks for all your work and time on this so far either way!

@pirate pirate closed this Apr 16, 2025
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.

4 participants