From f669e5dd34c29846137bfc6c8633c1a76f0f1bfa Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 16 Aug 2022 13:02:46 +0200 Subject: [PATCH] Ignoring "resize" events during printing (issue 15324) This is a quick work-around, to prevent the viewer from breaking as a result of https://bugzilla.mozilla.org/show_bug.cgi?id=774398 --- web/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index c53ebc71e..8915749dd 100644 --- a/web/app.js +++ b/web/app.js @@ -2514,7 +2514,12 @@ function webViewerSpreadModeChanged(evt) { } function webViewerResize() { - const { pdfDocument, pdfViewer } = PDFViewerApplication; + const { pdfDocument, pdfViewer, pdfRenderingQueue } = PDFViewerApplication; + + if (pdfRenderingQueue.printing && window.matchMedia("print").matches) { + // Work-around issue 15324 by ignoring "resize" events during printing. + return; + } pdfViewer.updateContainerHeightCss(); if (!pdfDocument) {