refactor(stream-test): real-wheel into view, no synthetic-click fallback
Address review accuracy: humanClick used DOM scrollIntoViewIfNeeded and fell back to Playwright locator.click() when an element had no box - neither is real input. Now it brings elements into view with a real wheel scroll and throws if there is no on-screen box (no synthetic click). Header comment and README corrected: xdotool injects synthetic X input (not a physical HID device), and all actions are real input while the CDP/DOM API is used only to read state.
This commit is contained in:
@@ -8,13 +8,16 @@ real browsing session captured from the X display.
|
||||
until stopped. All params from `.env` (`DISCORD_SELFBOT_TOKEN`,
|
||||
`DISCORD_GUILD_ID`, `DISCORD_VOICE_CHANNEL_ID`, `VNC_RESOLUTION`,
|
||||
`VNC_FRAMERATE`, `VNC_BITRATE_KBPS`, `STREAM_HW`, `VNC_DISPLAY`).
|
||||
- `human.mjs` - human-like interaction helpers. Real mouse/keyboard via
|
||||
`xdotool` (so the cursor is visible in the stream); Playwright only locates
|
||||
elements. Every action is real input: address-bar navigation (Ctrl+L +
|
||||
typing), search typing, clicking the video / settings menu / autoplay toggle /
|
||||
play button, fullscreen via the `f` key, scrolling, and entering links. The
|
||||
CDP/DOM API is used only to read state for verification, and as a rare click
|
||||
fallback when an element has no on-screen box.
|
||||
- `human.mjs` - human-like interaction helpers. Input is injected into the X
|
||||
server with `xdotool` (synthetic X input, not a physical HID device, but the
|
||||
browser and the captured screen see genuine pointer/keyboard events with a
|
||||
visibly moving cursor); Playwright only locates elements. Every action is such
|
||||
input: address-bar navigation (Ctrl+L + typing), search typing, clicking the
|
||||
video / settings menu / autoplay toggle / play button, fullscreen via the `f`
|
||||
key, and scrolling. Elements are brought into view with a real wheel scroll
|
||||
(no DOM scrollIntoView); if an element has no on-screen box the click fails
|
||||
rather than falling back to a synthetic click. The CDP/DOM API is used only to
|
||||
read state for verification, never to act.
|
||||
- `scenario.mjs` - the browse scenario (YouTube -> IU live -> 1080p ->
|
||||
fullscreen -> Naver -> 나무위키), driven with the human helpers. Connects to a
|
||||
Chrome already running with `--remote-debugging-port` (`CDP_PORT`, default
|
||||
|
||||
Reference in New Issue
Block a user