()
| 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 | } |
no test coverage detected