mirror of
https://github.com/daijro/camoufox.git
synced 2026-09-08 16:01:00 +00:00
fix(python): bound headful geometry again after the get_screen_cons flip
PR #315 corrects get_screen_cons()'s inverted guard (`headless is False` ->
`headless is True`), which is right on its own. But the call site passes
`headless or has_display(env)`, folding two separate questions into one
boolean, so with the corrected guard a headful run on a real display now
reads as headless and the display bound is skipped:
headless=False, has_display=True -> arg=True -> None (want Screen)
headless=False, has_display=False -> arg=False -> Screen (want None)
That drops the monitor bound for every ordinary headful launch, which is
the constraint 2266f27 added for #499 -- a 1366x768 laptop goes back to
being handed a 2560x1440 fingerprint and a window drawn past the edge of
the screen.
Pass `headless` alone and gate on has_display() separately.
largest_display() already returns None when there is nothing to probe, so
the no-display case still yields None.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GQgHHGRXNp29jr4xQjK7iv
This commit is contained in:
co-authored by
Claude Opus 5
parent
0169975638
commit
0e1f9a816d
@@ -786,7 +786,10 @@ def launch_options(
|
||||
|
||||
# Bound the geometry to the real display. BrowserForge only honours this when
|
||||
# its pool has a match, so it is re-applied after generation as well.
|
||||
screen_cons = screen or get_screen_cons(headless or has_display(env))
|
||||
# `headless` and "is there a display to probe" are separate questions: passing
|
||||
# `headless or has_display(env)` made a headful run on a real display look like a
|
||||
# headless one to get_screen_cons(), which then skipped the bound entirely.
|
||||
screen_cons = screen or (get_screen_cons(headless) if has_display(env) else None)
|
||||
|
||||
if not _used_preset and fingerprint is None:
|
||||
# Default: BrowserForge synthetic generation (infinite unique fingerprints)
|
||||
|
||||
Reference in New Issue
Block a user