From 38dd219d858da8056caeb8506479aa3836d55a35 Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Tue, 22 Nov 2022 17:48:53 +0100 Subject: [PATCH] Unblock the load event when the pdf has a password (bug 1801341) --- web/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/app.js b/web/app.js index 8c77243d9..72019cabd 100644 --- a/web/app.js +++ b/web/app.js @@ -943,6 +943,13 @@ const PDFViewerApplication = { this.pdfLoadingTask = loadingTask; loadingTask.onPassword = (updateCallback, reason) => { + if (this.isViewerEmbedded) { + // The load event can't be triggered until the password is entered, so + // if the viewer is in an iframe and its visibility depends on the + // onload callback then the viewer never shows (bug 1801341). + this._unblockDocumentLoadEvent(); + } + this.pdfLinkService.externalLinkEnabled = false; this.passwordPrompt.setUpdateCallback(updateCallback, reason); this.passwordPrompt.open();