From d959cb824d71a8cb0614a0a24616add2cec40957 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 23 Jun 2021 14:00:54 +0200 Subject: [PATCH] Reset the `IPDFLinkService.externalLinkEnabled` property on document closing Given that this property is only used with password protected documents, and is consequently document-specific rather than viewer-specific, ensure that `IPDFLinkService.externalLinkEnabled` is actually being reset by `PDFViewerApplication.close`. To make things less confusing/inconsistent, remove the *undocumented* `externalLinkEnabled` property from the `PDFLinkService` constructor and force it to always be manually set when needed. --- web/app.js | 1 + web/pdf_link_service.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index f2c79b840ef11..7a08ee5abcce5 100644 --- a/web/app.js +++ b/web/app.js @@ -828,6 +828,7 @@ const PDFViewerApplication = { this.pdfDocumentProperties.setDocument(null); } webViewerResetPermissions(); + this.pdfLinkService.externalLinkEnabled = true; this._fellback = false; this.store = null; this.isInitialViewSet = false; diff --git a/web/pdf_link_service.js b/web/pdf_link_service.js index 29d6d2daaab98..54ff04594c197 100644 --- a/web/pdf_link_service.js +++ b/web/pdf_link_service.js @@ -41,13 +41,12 @@ class PDFLinkService { eventBus, externalLinkTarget = null, externalLinkRel = null, - externalLinkEnabled = true, ignoreDestinationZoom = false, } = {}) { this.eventBus = eventBus; this.externalLinkTarget = externalLinkTarget; this.externalLinkRel = externalLinkRel; - this.externalLinkEnabled = externalLinkEnabled; + this.externalLinkEnabled = true; this._ignoreDestinationZoom = ignoreDestinationZoom; this.baseUrl = null;