safeScrollToTop (#2030)
This commit is contained in:
@@ -1962,7 +1962,7 @@ function safeWindowScroll(x, y) {
|
||||
}
|
||||
}
|
||||
|
||||
async function scrollToTop(
|
||||
async function safeScrollToTop(
|
||||
draw_boxes,
|
||||
frame = "main.frame",
|
||||
frame_index = undefined,
|
||||
|
||||
@@ -204,7 +204,7 @@ class SkyvernFrame:
|
||||
:param page: Page instance to take the screenshot from.
|
||||
:return: Screenshot of the page.
|
||||
"""
|
||||
js_script = "async ([draw_boxes, frame, frame_index]) => await scrollToTop(draw_boxes, frame, frame_index)"
|
||||
js_script = "async ([draw_boxes, frame, frame_index]) => await safeScrollToTop(draw_boxes, frame, frame_index)"
|
||||
scroll_y_px = await self.evaluate(
|
||||
frame=self.frame,
|
||||
expression=js_script,
|
||||
|
||||
Reference in New Issue
Block a user