Expand description
Cross-origin iframe evaluation helpers.
CAPTCHA providers (reCAPTCHA, hCaptcha, Turnstile) render their challenges
inside sandboxed cross-origin iframes. JavaScript running in the parent
page cannot pierce these iframes via contentDocument or
contentWindow.document — doing so throws a SecurityError.
This module uses the Chrome DevTools Protocol to evaluate expressions in each frame’s own execution context, which works regardless of origin.
Functions§
- evaluate_
in_ all_ frames - Evaluate
expressionin every frame of the page (main document + all iframes) and return the deserialized results from every frame that produced a valid value. - evaluate_
in_ frames_ first - Evaluate
expressionin every frame and return the first result that passesfilter. If no frame produces a matching result,defaultis returned. - find_
element_ centre_ in_ frames - Search every frame for a DOM element matching
selectorand return its bounding-box centre coordinates relative to the main viewport. - verify_
token_ in_ frames - Check whether a CAPTCHA response token exists in any frame. Used for post-solve verification when the provider may inject the token into a hidden input in the main document or inside an iframe.