From 76bedb5251022cdd5140193905983fb0919b212c Mon Sep 17 00:00:00 2001 From: daijro Date: Wed, 9 Oct 2024 06:20:57 -0500 Subject: [PATCH] pythonlib: Hotfix screen property out of bounds 0.2.11 Adds back handling for when Browserforge screen properties are out of bounds. --- pythonlib/camoufox/fingerprints.py | 3 +++ pythonlib/pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pythonlib/camoufox/fingerprints.py b/pythonlib/camoufox/fingerprints.py index 2bae12e..d496b0d 100644 --- a/pythonlib/camoufox/fingerprints.py +++ b/pythonlib/camoufox/fingerprints.py @@ -31,6 +31,9 @@ def _cast_to_properties( if isinstance(data, dict): _cast_to_properties(camoufox_data, type_key, data, ff_version) continue + # Fix values that are out of bounds + if type_key.startswith("screen.") and isinstance(data, int) and data < 0: + data = 0 # Replace the Firefox versions with ff_version if ff_version and isinstance(data, str): data = re.sub(r'(?"] license = "MIT"