From a348162c5bc4c80144e3ff1595f383dcc3dd2518 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 7 Feb 2023 16:20:27 +0100 Subject: [PATCH] [GeckoView] Skip fetching/parsing of pageLabels Currently there's no toolbar in the GV-viewer, hence invoking the pageLabels functionality isn't meaningful and just leads to unnecessary parsing on both the main- and worker-threads. (And if a toolbar is added at some point, it's not clear to me if we'd want to support pageLabels in the GV-viewer anyway.) --- web/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/app.js b/web/app.js index ccc6b371d..54aafeaa6 100644 --- a/web/app.js +++ b/web/app.js @@ -1531,6 +1531,13 @@ const PDFViewerApplication = { * @private */ async _initializePageLabels(pdfDocument) { + if ( + typeof PDFJSDev === "undefined" + ? window.isGECKOVIEW + : PDFJSDev.test("GECKOVIEW") + ) { + return; + } const labels = await pdfDocument.getPageLabels(); if (pdfDocument !== this.pdfDocument) {