current viewpoint screenshot and scrolling n screenshot (#2716)

Co-authored-by: lawyzheng <lawyzheng1106@gmail.com>
This commit is contained in:
Shuchang Zheng
2025-06-13 23:59:50 -07:00
committed by GitHub
parent 11288817af
commit 775da18878
39 changed files with 452 additions and 35 deletions

View File

@@ -2115,13 +2115,14 @@ async function scrollToNextPage(
draw_boxes,
frame = "main.frame",
frame_index = undefined,
need_overlap = true,
) {
// remove bounding boxes, scroll to next page with 200px overlap, then draw bounding boxes again
// return true if there is a next page, false otherwise
removeBoundingBoxes();
window.scrollBy({
left: 0,
top: window.innerHeight - 200,
top: need_overlap ? window.innerHeight - 200 : window.innerHeight,
behavior: "instant",
});
if (draw_boxes) {