mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-10-18 23:07:13 -05:00
Python + JS wrappers. Add a stealth_dom / stealthDom module: reimplements the common Playwright selector grammar (css, :has-text, text=, xpath=, trailing >> nth=N) for direct DOM resolution in the isolated execution context, with a fallback to the regular Playwright read for grammar it can't resolve. World reads are wrapped so a world/CDP failure falls back rather than propagating out of the humanized action. ensure_actionable, ensure_stable, scroll geometry (_get_element_box + the no_viewport window-size read), and check_pointer_events now read through it, sync and async. Selector-based main-page actions (click/dblclick/hover/type/ fill/focus/press) are covered; ElementHandle and sub-frame paths unchanged. JS routes Locator actions through frame methods, so main-frame locator clicks now delegate to the humanized page methods (which use the shared helpers) instead of the frame-scoped Playwright reads; sub-frames unchanged. Tests: builders + parse, the rewired helpers' branching via a mock isolated world, a Node-driven check of the shipped resolver JS selector semantics, and a guard that main-frame locator clicks delegate to the humanized page path.