Skip to content

Automate browser based workflows with AI

fix dom listener bug (#3095)

LawyZhengf33906509f11
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js
index 415b20c10..8f6fcc627 100644
--- a/skyvern/webeye/scraper/domUtils.js
+++ b/skyvern/webeye/scraper/domUtils.js
@@ -2579,8 +2579,10 @@ async function stopGlobalIncrementalObserver() {
window.globalObserverForDOMIncrement.disconnect();
window.globalObserverForDOMIncrement.takeRecords(); // cleanup the older data
while (
+ window.globalParsedElementCounter &&
+ window.globalOneTimeIncrementElements &&
(await window.globalParsedElementCounter.get()) <
- window.globalOneTimeIncrementElements.length
+ window.globalOneTimeIncrementElements.length
) {
await asyncSleepFor(100);
}