From 7f8a9b12d9e521c68e5b055b52b860059f4ef19e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 14 Feb 2021 10:39:34 +0100 Subject: [PATCH] Stop including the "errorWrapper" HTML code in `MOZCENTRAL`-builds Given that these HTML elements are not being used at all in `MOZCENTRAL`-builds, note the preprocessor check in `PDFViewerApplication._otherError`, we obviously don't need the HTML code either. --- web/app.js | 6 ++++-- web/viewer.html | 2 ++ web/viewer.js | 21 +++++++++++++-------- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/web/app.js b/web/app.js index dc080e7ca..69a155a64 100644 --- a/web/app.js +++ b/web/app.js @@ -824,8 +824,10 @@ const PDFViewerApplication = { async close() { this._unblockDocumentLoadEvent(); - const errorWrapper = this.appConfig.errorWrapper.container; - errorWrapper.hidden = true; + if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) { + const { container } = this.appConfig.errorWrapper; + container.hidden = true; + } if (!this.pdfLoadingTask) { return undefined; diff --git a/web/viewer.html b/web/viewer.html index 4f1d08091..c390ba62e 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -320,6 +320,7 @@ See https://github.com/adobe-type-tools/cmap-resources
+