Skip to content

Commit 98f19d0

Browse files
fix(desktop): bypass preview capture overlay for hidden hosts
1 parent 1698cc3 commit 98f19d0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎apps/desktop/src/preview/PreviewCapture.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export const withUnscaledPreviewCapture = <A, E, R>(
3232
if (!host || host.isDestroyed()) return yield* unscaledCapture;
3333
const scaled = yield* Effect.tryPromise((_signal) =>
3434
host.executeJavaScript(`(() => {
35+
// Hidden hosts suspend animation frames, so overlay setup cannot finish.
36+
if (document.visibilityState !== "visible") return false;
3537
const view = document.querySelector("webview[${tabAttribute}=" + CSS.escape(${encodeString(tabId)}) + "]");
3638
return !!view && view.getWebContentsId() === ${wc.id} && getComputedStyle(view).transform !== "none";
3739
})()`),

0 commit comments

Comments
 (0)