Skip to content

Automate browser based workflows with AI

fix dom listener bug (#2344)

Shuchang Zheng193df54c6e0e
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js
index 82e96803c..7b6d82e41 100644
--- a/skyvern/webeye/scraper/domUtils.js
+++ b/skyvern/webeye/scraper/domUtils.js
@@ -2364,6 +2364,9 @@ if (window.globalObserverForDOMIncrement === undefined) {
if (node.nodeType === Node.TEXT_NODE) continue;
const tagName = node.tagName?.toLowerCase();
+ // ignore unique_id change to avoid infinite loop about DOM changes
+ if (mutation.attributeName === "unique_id") continue;
+
// if the changing element is dropdown related elements, we should consider
// they're the new element as long as the element is still visible on the page
if (
@@ -2432,6 +2435,7 @@ if (window.globalObserverForDOMIncrement === undefined) {
break;
}
}
+ break;
}
case "childList": {
let changedNode = {