Merge pull request #15727 from calixteman/bug1801341

Unblock the load event when the pdf has a password (bug 1801341)
This commit is contained in:
calixteman 2022-11-23 12:09:12 +01:00 committed by GitHub
commit 8cd2adf8a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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