Skip to content

Automate browser based workflows with AI

fix domutils potential bugs (#767)

LawyZheng2097d01471dc
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js
index db4f5dfc9..c26245035 100644
--- a/skyvern/webeye/scraper/domUtils.js
+++ b/skyvern/webeye/scraper/domUtils.js
@@ -1639,7 +1639,7 @@ if (window.globalDomDepthMap === undefined) {
function isClassNameIncludesHidden(className) {
// some hidden elements are with the classname like `class="select-items select-hide"`
- return className.includes("hide");
+ return className.toLowerCase().includes("hide");
}
function addIncrementalNodeToMap(parentNode, childrenNode) {
@@ -1669,7 +1669,7 @@ if (window.globalObserverForDOMIncrement === undefined) {
if (mutation.type === "attributes") {
if (mutation.attributeName === "style") {
// TODO: need to confirm that elemnent is hidden previously
- node = mutation.target;
+ const node = mutation.target;
if (node.nodeType === Node.TEXT_NODE) continue;
const newStyle = window.getComputedStyle(node);
const newDisplay = newStyle.display;
@@ -1682,7 +1682,7 @@ if (window.globalObserverForDOMIncrement === undefined) {
}
}
if (mutation.attributeName === "class") {
- node = mutation.target;
+ const node = mutation.target;
if (
!mutation.oldValue ||
!isClassNameIncludesHidden(mutation.oldValue)