mirror of
https://github.com/daijro/camoufox.git
synced 2026-08-18 16:00:58 +00:00
541ffca302
Commit 9270618 fixed the exact-edge mousemove deadlock for the requested
endpoint by treating x==width / y==height as out-of-viewport (>= not >),
now at PageHandler.js:589. A mousemove landing exactly on the edge fires as
an exit event rather than eMouseMove, so no hit-renderer ack is produced;
because dispatch is serialized on the process-global activation chain in
TargetRegistry.js activateAndRun(), one missing ack wedges all later input.
The humanize trajectory added afterwards in 15f2912 (#677) introduced a
second, independent bounds check for the intermediate points it generates,
written in the old strict-> form. Those points never pass through the
endpoint guard, so they could still land exactly on the edge and deadlock:
PageHandler.js:566 currentX > boundingBox.width intermediate points
PageHandler.js:589 x >= boundingBox.width requested endpoint
This is reachable rather than theoretical. MouseTrajectories.hpp:65-74 rounds
every point to int, and :83-86 builds the curve's control knots with a +/-80px
boundary around the endpoints, so any target within 80px of an edge produces a
curve that sweeps across the boundary column and lands on it exactly. Points
beyond the edge are skipped safely by the continue; points on it are dispatched
and hang.
Reproduced against the built v152.0.4-beta.25 binary: a humanized move to
(997, 200) in a 1000x700 viewport hung indefinitely (20s timeout) and left the
browser unresponsive to all further input. With the guard aligned, all five
edge-directed moves complete and input stays live.
Add tests/patches/humanize-edge-deadlock.py covering it, and confirm
humanize-mouse-trajectory.py (#677) still passes: 151 intermediate moves
ending exactly on target, humanized click still lands.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Camoufox Tests
Ensures that Playwright functionality is not broken.
This directory is based on the original Playwright-Python tests.
It has been modified to skip tests that use the following features:
- Injecting JavaScript into the page or writing to DOM. Camoufox's
page.evaluateonly supports reading values, not executing within the page context. - Overriding the User-Agent.
- Any tests specific to Chromium or Webkit.
Usage
Setting up the environment
Cd to this directory and run the following command to setup the venv and install the dependencies:
bash setup-venv.sh
Running the tests
Run via the shell script:
bash run-tests.sh --headful --executable-path /path/to/camoufox-bin
Or through the Makefile:
make tests headful=true