MCPcopy Create free account
hub / github.com/027xiguapi/code-box / captureAndScroll

Function captureAndScroll

contents/custom.tsx:56–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

54 let capturedImages = []
55
56 const captureAndScroll = async () => {
57 const scrollAmount = clientHeight * devicePixelRatio
58 const res = await sendToBackground({ name: "screenshot" })
59 const dataUrl = res.dataUrl
60
61 capturedHeight += scrollAmount
62 if (capturedHeight < scrollHeight * devicePixelRatio) {
63 capturedImages.push(dataUrl)
64 window.scrollTo(0, capturedHeight)
65 setTimeout(captureAndScroll, 2000) // Adjust the delay as needed
66 } else {
67 DrawImages(capturedImages, articleTitle)
68 }
69 }
70
71 captureAndScroll()
72 }

Callers 1

CustomOverlayFunction · 0.85

Calls 1

DrawImagesFunction · 0.85

Tested by

no test coverage detected