Skip to content

Commit 13f4ee3

Browse files
TonybynMp4claude
andcommitted
fix(server): drop the uncapped screenshot unless it is saved
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7c2a120 commit 13f4ee3

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎apps/server/src/preview/ServerBrowserPage.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -543,10 +543,14 @@ const capture = async (
543543
"url" | "title" | "loading" | "visibleText" | "interactiveElements"
544544
>
545545
>,
546-
captureViewport(input.cdp, { format: "png" }).then(async (full) => ({
547-
full,
548-
data: scale < 1 ? await shrinkPng(input.cdp, full, scale) : full,
549-
})),
546+
captureViewport(input.cdp, { format: "png" }).then(async (full) =>
547+
scale < 1
548+
? {
549+
data: await shrinkPng(input.cdp, full, scale),
550+
full: input.fullScreenshot ? full : undefined,
551+
}
552+
: { data: full, full: undefined },
553+
),
550554
]);
551555
void pageAndScreenshot.catch(constVoid);
552556
// Leaves time for the second read; a frame that never loads holds the tree until then.
@@ -597,9 +601,7 @@ const capture = async (
597601
data,
598602
...pngSize(data),
599603
},
600-
...(input.fullScreenshot && full !== data
601-
? { fullScreenshot: { data: full, ...pngSize(full) } }
602-
: {}),
604+
...(full !== undefined ? { fullScreenshot: { data: full, ...pngSize(full) } } : {}),
603605
};
604606
};
605607

0 commit comments

Comments
 (0)