Skip to content

Migrating from Camoufox

Camoufox and Clearcote work the same way: both patch the engine and hand you a Playwright object. Moving is mostly a rename, from Firefox to Chromium.

The change

from camoufox.sync_api import Camoufox
from clearcote import launch

with Camoufox(
browser = launch(
    headless=True,
    os="windows",
    platform="windows",
    fingerprint="acct-1",         # new: one seed per account, the same device every run
    geoip=True,
    proxy={"server": "http://proxy.example:8080", "username": "user", "password": "pass"},
    humanize=True,
) as browser:
    page = browser.new_page()
    page.goto("https://example.com")
)
page = browser.new_page()
page.goto("https://example.com")
browser.close()

Option by option

CamoufoxClearcote
headless="virtual"headless=True (the default): headless already gets a real-size screen
os= a list of systemsplatform="windows", "macos" or "linux"; pick one per account
a fresh fingerprint on every launchfingerprint="<seed>": the same seed is the same device, a new seed is an unrelated one
locale="de-DE"accept_language="de-DE,de", or let geoip set it
persistent_context=True, user_data_dir=...launch_persistent_context(user_data_dir, ...)
addons=[path] (Firefox add-ons)extensions=[path]: unpacked Chrome extensions
block_images=TruePlaywright's page.route, as below
config={...}, firefox_user_prefsNo equivalent. Fingerprint values come from the seed, or from a captured device profile
python
# instead of block_images=True
page.route("**/*", lambda route: route.abort() if route.request.resource_type == "image" else route.continue_())

Firefox to Chromium

  • Your Playwright code runs as it is. Locators, evaluate, routes and waits are the same API on both engines.
  • You gain Chromium-only parts: page.pdf(), a CDP session, and a CDP endpoint any tool can attach to with serve().
  • Profiles do not carry over. Chromium cannot open a Firefox profile. Save the cookies from Camoufox with context.storage_state(path="state.json") and load them with context.add_cookies(state["cookies"]). The site sees a new device once.
  • Not only Python. The same launch() is in the Node and .NET SDKs, and there is a Docker image.

Check the switch

clearcote info prints the build the SDK resolves and a launch test. Without a licence key that is the open build (BSD-3); a proxy with a username and password needs the latest build, free with a GitHub sign-in. Next: Recommended settings. Comparison: Clearcote vs Camoufox.