ddp_utils.browser.backends.playwright.camoufox_runtime¶
import ddp_utils.browser.backends.playwright.camoufox_runtime
Camoufox package and browser-binary compatibility management.
- class ddp_utils.browser.backends.playwright.camoufox_runtime.CamoufoxRuntimeStatus(package_version: str, browser_version: str, browser_path: Path, geoip_available: bool, refreshed: bool)¶
Bases:
objectDescribe one verified Camoufox package and browser binary pair.
Parameters
Name
Type
Description
package_version
str
Installed Camoufox Python package version.
browser_version
str
Version reported for the active Camoufox browser.
browser_path
Path
Absolute path to the compatible browser directory.
geoip_available
bool
Whether the optional GeoIP dependency is installed.
refreshed
bool
Whether this call replaced a stale active browser binary.
Examples
Inspect the verified binary version:
status = prepare_camoufox_runtime() print(status.browser_version)
- ddp_utils.browser.backends.playwright.camoufox_runtime.prepare_camoufox_runtime(policy: str = 'ensure') CamoufoxRuntimeStatus¶
Verify and synchronize Camoufox’s package-specific browser cache.
A marker inside Camoufox’s own install directory records the package and browser binary that completed preparation.
ensurereuses a matching binary and refreshes it after a package-version change.verifynever downloads or deletes a binary.refreshexplicitly replaces the active build.Parameters
Name
Type
Description
policy
str
verify,ensure, orrefresh.Returns
Type
Description
Verified package and browser runtime information.
Raises
Exception
Description
RuntimeError
Camoufox, GeoIP support, or a compatible binary is absent.
ValueError
The policy is unsupported.
Examples
Repair a missing or stale browser binary:
status = prepare_camoufox_runtime("ensure")
Validate an offline deployment without changing its cache:
status = prepare_camoufox_runtime("verify")