From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 30 Oct 2025 22:29:56 +0000 (-0700) Subject: Update document-detail.component.ts X-Git-Tag: v2.19.4~18^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8c75d95d8314dd8a5bb2ec2ea37a8d738a2a91c;p=thirdparty%2Fpaperless-ngx.git Update document-detail.component.ts --- 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' ||