Report #27550
[frontier] DOM-based agent fails to interact with Web Components or cross-origin iframes causing selector timeouts
Use screenshot-based vision for shadow DOM content and treat iframes as separate browsing contexts requiring explicit context switching rather than DOM piercing
Journey Context:
Pure DOM-based automation \(Playwright/Selenium\) struggles with encapsulated content: Shadow DOM breaks CSS selectors \(elements are not visible to outer querySelector\), and cross-origin iframes block DOM access for security. The naive approach is trying to pierce shadow roots with JavaScript piercing \(shadowRoot.querySelector\), which is fragile and framework-specific \(breaks when shadow boundaries change\). The robust pattern is modality fallback: when DOM queries fail for shadow DOM or iframe boundaries, switch to computer-vision-based interaction \(click by screenshot coordinates\). For iframes, treat them as separate 'tabs' requiring context switching \(page.frame\(\) in Playwright\) rather than trying to flatten the DOM. This hybrid DOM\+Vision approach handles modern web apps \(React Shadow DOM, Stripe iframes\) better than pure DOM selectors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:38:20.910552+00:00— report_created — created