From a8c75d95d8314dd8a5bb2ec2ea37a8d738a2a91c Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:29:56 -0700 Subject: [PATCH] Update document-detail.component.ts --- .../document-detail/document-detail.component.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src-ui/src/app/components/document-detail/document-detail.component.ts b/src-ui/src/app/components/document-detail/document-detail.component.ts index e7197b9b91..3c692e4961 100644 --- a/src-ui/src/app/components/document-detail/document-detail.component.ts +++ b/src-ui/src/app/components/document-detail/document-detail.component.ts @@ -1448,13 +1448,11 @@ export class DocumentDetailComponent iframe.contentWindow.focus() iframe.contentWindow.print() iframe.contentWindow.onafterprint = () => { - timer(100).subscribe(() => { - // delay to avoid FF print failure - document.body.removeChild(iframe) - URL.revokeObjectURL(blobUrl) - }) + document.body.removeChild(iframe) + URL.revokeObjectURL(blobUrl) } } catch (err) { + // FF throws cross-origin error on onafterprint const isCrossOriginAfterPrintError = err instanceof DOMException && (err.name === 'SecurityError' || -- 2.47.3