From ab02998d199046b164ca30add16a01cdfff26c4e Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Wed, 5 Mar 2025 14:37:15 -0500 Subject: [PATCH] fix element invisible detect (#1889) Co-authored-by: lawyzheng Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- skyvern/webeye/scraper/domUtils.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js index b55cf8fd..c34e4af0 100644 --- a/skyvern/webeye/scraper/domUtils.js +++ b/skyvern/webeye/scraper/domUtils.js @@ -257,7 +257,11 @@ function isElementStyleVisibilityVisible(element, style) { // TODO: support style.clipPath and style.clipRule? // if element is clipped with rect(0px, 0px, 0px, 0px), it means it's invisible on the page - if (style.clip === "rect(0px, 0px, 0px, 0px)") { + // FIXME: need a better algorithm to calculate the visible rect area, using (right-left)*(bottom-top) from rect(top, right, bottom, left) + if ( + style.clip === "rect(0px, 0px, 0px, 0px)" || + style.clip === "rect(1px, 1px, 1px, 1px)" + ) { return false; }