From 46b61ff12e42acbfc149e51f4619ad1845c503ca Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 21 Jul 2019 13:42:03 +0200 Subject: [PATCH] Avoid creating a `PDFFindBar` instance, in the Firefox built-in viewer, when not actually necessary This is similar to how `PDFPresentationMode` isn't used when the Fullscreen API isn't supported. --- web/app.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app.js b/web/app.js index a40e27db6..a829f3776 100644 --- a/web/app.js +++ b/web/app.js @@ -352,7 +352,9 @@ let PDFViewerApplication = { }); pdfLinkService.setHistory(this.pdfHistory); - this.findBar = new PDFFindBar(appConfig.findBar, eventBus, this.l10n); + if (!this.supportsIntegratedFind) { + this.findBar = new PDFFindBar(appConfig.findBar, eventBus, this.l10n); + } this.pdfDocumentProperties = new PDFDocumentProperties(appConfig.documentProperties, @@ -598,7 +600,9 @@ let PDFViewerApplication = { this.pdfOutlineViewer.reset(); this.pdfAttachmentViewer.reset(); - this.findBar.reset(); + if (this.findBar) { + this.findBar.reset(); + } this.toolbar.reset(); this.secondaryToolbar.reset();