Update document-detail.component.ts

This commit is contained in:
shamoon 2025-10-30 15:29:56 -07:00
parent d6e2456baf
commit a8c75d95d8

View File

@ -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' ||