mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
fix(humanize): forward human_config in all chained methods, use evaluate args in handle pointer checks
- Add human_config=kwargs.get("human_config") to check/uncheck/select_option/press inner calls (sync+async+JS)
- Convert check_pointer_events_handle from f-string interpolation to evaluate args pattern (sync+async+JS)
This commit is contained in:
@@ -23,6 +23,7 @@ from .actionability import (
|
||||
_BACKOFF_MS,
|
||||
_boxes_differ,
|
||||
_POINTER_EVENTS_LOCATOR_JS,
|
||||
_POINTER_EVENTS_HANDLE_JS,
|
||||
)
|
||||
|
||||
|
||||
@@ -226,18 +227,11 @@ async def async_check_pointer_events_handle(
|
||||
deadline = time.monotonic() + timeout / 1000.0
|
||||
attempt = 0
|
||||
|
||||
js = f"""(expected) => {{
|
||||
const target = document.elementFromPoint({x}, {y});
|
||||
if (!target) return {{ hit: false, reason: 'no_element_at_point', covering: 'none' }};
|
||||
let node = target;
|
||||
while (node) {{ if (node === expected) return {{ hit: true }}; node = node.parentNode; }}
|
||||
if (expected.contains(target)) return {{ hit: true }};
|
||||
return {{ hit: false, reason: 'covered', covering: target.tagName || 'unknown' }};
|
||||
}}"""
|
||||
coords = {"x": x, "y": y}
|
||||
|
||||
while True:
|
||||
try:
|
||||
result = await el.evaluate(js)
|
||||
result = await el.evaluate(_POINTER_EVENTS_HANDLE_JS, coords)
|
||||
except Exception:
|
||||
result = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user