pythonlib: Rollback WebGL fingerprint injection 0.4.2

Rolling back WebGL injection temporarily until the crashing issue on certain devices is fixed.
This commit is contained in:
daijro 2024-11-22 02:57:31 -06:00
parent 673fdc7271
commit 01aff40fc5
2 changed files with 9 additions and 4 deletions

View file

@ -380,7 +380,7 @@ def launch_options(
block_webrtc (Optional[bool]): block_webrtc (Optional[bool]):
Whether to block WebRTC entirely. Whether to block WebRTC entirely.
block_webgl (Optional[bool]): block_webgl (Optional[bool]):
Whether to allow WebGL. To prevent leaks, only use this for special cases. Whether to block WebGL. To prevent leaks, only use this for special cases.
geoip (Optional[Union[str, bool]]): geoip (Optional[Union[str, bool]]):
Calculate longitude, latitude, timezone, country, & locale based on the IP address. Calculate longitude, latitude, timezone, country, & locale based on the IP address.
Pass the target IP address to use, or `True` to find the IP address automatically. Pass the target IP address to use, or `True` to find the IP address automatically.
@ -559,14 +559,19 @@ def launch_options(
firefox_user_prefs['permissions.default.image'] = 2 firefox_user_prefs['permissions.default.image'] = 2
if block_webrtc: if block_webrtc:
firefox_user_prefs['media.peerconnection.enabled'] = False firefox_user_prefs['media.peerconnection.enabled'] = False
if block_webgl:
# Add back allow_webgl for compatibility
if block_webgl or not launch_options.pop('allow_webgl', True):
firefox_user_prefs['webgl.disabled'] = True firefox_user_prefs['webgl.disabled'] = True
else: else:
# Select a random webgl pair # ROLLBACK: WebGL injection causing crashing on some devices.
"""
if webgl_config: if webgl_config:
merge_into(config, sample_webgl(target_os, *webgl_config)) merge_into(config, sample_webgl(target_os, *webgl_config))
else: else:
merge_into(config, sample_webgl(target_os)) merge_into(config, sample_webgl(target_os))
"""
# Use software rendering to be less unique # Use software rendering to be less unique
merge_into( merge_into(
firefox_user_prefs, firefox_user_prefs,

View file

@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry] [tool.poetry]
name = "camoufox" name = "camoufox"
version = "0.4.1" version = "0.4.2"
description = "Wrapper around Playwright to help launch Camoufox" description = "Wrapper around Playwright to help launch Camoufox"
authors = ["daijro <daijro.dev@gmail.com>"] authors = ["daijro <daijro.dev@gmail.com>"]
license = "MIT" license = "MIT"