remove unneeded fetch

This commit is contained in:
Simon Knott 2024-10-15 15:04:46 +02:00
parent 6d0f0bed3f
commit e19f0ee735
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -305,7 +305,6 @@ function snapshotScript(screenshotURL: string | undefined, ...targetIds: (string
const canvases = root.querySelectorAll('canvas'); const canvases = root.querySelectorAll('canvas');
if (canvases.length > 0 && screenshotURL) { if (canvases.length > 0 && screenshotURL) {
fetch(screenshotURL).then(response => response.blob()).then(blob => {
const img = new Image(); const img = new Image();
img.onload = () => { img.onload = () => {
for (const canvas of canvases) { for (const canvas of canvases) {
@ -320,8 +319,7 @@ function snapshotScript(screenshotURL: string | undefined, ...targetIds: (string
context.drawImage(img, xStart * img.width, yStart * img.height, (xEnd - xStart) * img.width, (yEnd - yStart) * img.height, 0, 0, canvas.width, canvas.height); context.drawImage(img, xStart * img.width, yStart * img.height, (xEnd - xStart) * img.width, (yEnd - yStart) * img.height, 0, 0, canvas.width, canvas.height);
} }
}; };
img.src = URL.createObjectURL(blob); img.src = screenshotURL;
});
} }
{ {