remove unneeded fetch
This commit is contained in:
parent
6d0f0bed3f
commit
e19f0ee735
|
|
@ -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;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue