mirror of
https://github.com/daijro/camoufox.git
synced 2026-10-04 16:00:21 +00:00
chore(python): stop naming BrowserForge in user-facing text
fpgen replaced BrowserForge, but two LeakWarnings, the NonFirefoxFingerprint message and the fingerprint_preset docstring still named it. One warning also linked to a README anchor that no longer exists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c7dbca3926
commit
12dc47b03d
@@ -149,7 +149,7 @@ class NotInstalledGeoIPExtra(ImportError):
|
||||
|
||||
class NonFirefoxFingerprint(Exception):
|
||||
"""
|
||||
Raised when a passed Browserforge fingerprint is invalid.
|
||||
Raised when a passed fingerprint is not a Firefox fingerprint.
|
||||
"""
|
||||
|
||||
...
|
||||
|
||||
@@ -1789,7 +1789,7 @@ def generate_context_fingerprint(
|
||||
Generate fingerprint values for a single per-context identity.
|
||||
Returns a dict with init_script (JS string) and context_options (Playwright options).
|
||||
|
||||
By default, uses BrowserForge for infinite unique synthetic fingerprints.
|
||||
By default, fpgen generates a unique synthetic fingerprint.
|
||||
Pass a preset dict to use a real fingerprint preset instead.
|
||||
|
||||
Parameters:
|
||||
@@ -1830,21 +1830,21 @@ def generate_context_fingerprint(
|
||||
elif 'Linux' in plat or 'linux' in plat:
|
||||
os_name = 'linux'
|
||||
|
||||
# Add fonts (BrowserForge doesn't generate these)
|
||||
# Add fonts (fpgen.yml does not map these yet)
|
||||
if 'fonts' not in config:
|
||||
try:
|
||||
config['fonts'] = _generate_random_font_subset(os_name, seed=identity_seed(config, _salt))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Add voices (BrowserForge doesn't generate these)
|
||||
# Add voices (fpgen.yml does not map these yet)
|
||||
if 'voices' not in config:
|
||||
try:
|
||||
config['voices'] = _generate_random_voice_subset(os_name, seed=identity_seed(config, _salt))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Derive oscpu if BrowserForge didn't provide it
|
||||
# Derive oscpu if the fingerprint didn't provide it
|
||||
if 'navigator.oscpu' not in config:
|
||||
plat = config.get('navigator.platform', '')
|
||||
if plat == 'MacIntel':
|
||||
@@ -1854,7 +1854,7 @@ def generate_context_fingerprint(
|
||||
elif 'Linux' in plat or 'linux' in plat:
|
||||
config['navigator.oscpu'] = 'Linux x86_64'
|
||||
|
||||
# Sample WebGL vendor/renderer from database (BrowserForge doesn't generate these)
|
||||
# Sample WebGL vendor/renderer from database (fpgen.yml does not map these yet)
|
||||
if not config.get('webGl:vendor') or not config.get('webGl:renderer'):
|
||||
_os_map = {'macos': 'mac', 'linux': 'lin', 'windows': 'win'}
|
||||
_target_os = _os_map.get(os or '', None)
|
||||
@@ -1880,7 +1880,7 @@ def generate_context_fingerprint(
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Build source dicts from BrowserForge config for init_values
|
||||
# Build source dicts from the fingerprint config for init_values
|
||||
nav = {
|
||||
'platform': config.get('navigator.platform'),
|
||||
'hardwareConcurrency': config.get('navigator.hardwareConcurrency'),
|
||||
@@ -1974,7 +1974,7 @@ def _cast_to_properties(
|
||||
ff_version: Optional[str] = None,
|
||||
) -> None:
|
||||
"""
|
||||
Casts Browserforge fingerprints to Camoufox config properties.
|
||||
Casts a generated fingerprint to Camoufox config properties.
|
||||
"""
|
||||
for key, data in bf_dict.items():
|
||||
# Ignore non-truthy values
|
||||
|
||||
@@ -308,7 +308,7 @@ def get_env_vars(
|
||||
}
|
||||
os_dir = directory_map.get(user_agent_os, user_agent_os)
|
||||
|
||||
# v150+ uses "fontconfig/" (matching the Go launcher); older bundles shipped "fontconfigs/".
|
||||
# v150+ uses "fontconfig/"; older bundles shipped "fontconfigs/".
|
||||
def _bundle_path(*parts: str) -> str:
|
||||
if path:
|
||||
return str(path.parent.joinpath(*parts))
|
||||
@@ -884,9 +884,9 @@ def launch_options(
|
||||
If not provided, a random fingerprint will be generated based on the provided
|
||||
`os` & `screen` constraints.
|
||||
fingerprint_preset (Optional[Union[bool, Dict[str, Any]]]):
|
||||
Opt into using real fingerprint presets instead of BrowserForge.
|
||||
Opt into using real fingerprint presets instead of fpgen.
|
||||
Pass `True` to use a random bundled preset, or pass a preset dict directly.
|
||||
By default (None), BrowserForge is used for infinite unique fingerprints.
|
||||
By default (None), fpgen generates a unique fingerprint.
|
||||
ff_version (Optional[int]):
|
||||
Firefox version to use. Defaults to the current Camoufox version.
|
||||
To prevent leaks, only use this for special cases.
|
||||
@@ -1035,7 +1035,7 @@ def launch_options(
|
||||
# Generate a fingerprint
|
||||
_used_preset = False
|
||||
if fingerprint is not None:
|
||||
# User passed a custom BrowserForge fingerprint
|
||||
# User passed a custom fingerprint
|
||||
if not i_know_what_im_doing:
|
||||
check_custom_fingerprint(fingerprint)
|
||||
elif fingerprint_preset is not None:
|
||||
|
||||
@@ -17,12 +17,11 @@ header-ua: >-
|
||||
viewport: >-
|
||||
Manually setting screen & window properties is not recommended.
|
||||
Screen dimensions are randomly generated within Camoufox
|
||||
based on the provided screen constraints. See here:
|
||||
https://github.com/daijro/camoufox/tree/main/pythonlib#browserforge-integration.
|
||||
based on the provided screen constraints.
|
||||
|
||||
custom_fingerprint: >-
|
||||
Passing your own fingerprint is not recommended.
|
||||
BrowserForge fingerprints are automatically generated within Camoufox
|
||||
Fingerprints are automatically generated within Camoufox
|
||||
based on the provided `os` and `screen` constraints.
|
||||
|
||||
proxy_without_geoip: >-
|
||||
|
||||
Reference in New Issue
Block a user