Unblock the load event when the pdf has a password (bug 1801341)

This commit is contained in:
Calixte Denizet 2022-11-22 17:48:53 +01:00
parent 748be3f702
commit 38dd219d85

View File

@ -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();