Skip to content

Automate browser based workflows with AI

update window.scroll/scrollTo syntax (#2032)

Shuchang Zhenge601a872980c
diff --git a/skyvern/webeye/scraper/domUtils.js b/skyvern/webeye/scraper/domUtils.js
index ffa346a87..cbbc48a36 100644
--- a/skyvern/webeye/scraper/domUtils.js
+++ b/skyvern/webeye/scraper/domUtils.js
@@ -1959,9 +1959,9 @@ function removeBoundingBoxes() {
function safeWindowScroll(x, y) {
if (typeof window.scroll === "function") {
- window.scroll(x, y, { behavior: "instant" });
+ window.scroll({ left: x, top: y, behavior: "instant" });
} else if (typeof window.scrollTo === "function") {
- window.scrollTo(x, y, { behavior: "instant" });
+ window.scrollTo({ left: x, top: y, behavior: "instant" });
} else {
console.error("window.scroll and window.scrollTo are both not supported");
}