[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.)
This commit is contained in:
Jonas Jenwald 2023-02-07 16:20:27 +01:00
parent 8c4843f69a
commit a348162c5b

View File

@ -1531,6 +1531,13 @@ const PDFViewerApplication = {
* @private * @private
*/ */
async _initializePageLabels(pdfDocument) { async _initializePageLabels(pdfDocument) {
if (
typeof PDFJSDev === "undefined"
? window.isGECKOVIEW
: PDFJSDev.test("GECKOVIEW")
) {
return;
}
const labels = await pdfDocument.getPageLabels(); const labels = await pdfDocument.getPageLabels();
if (pdfDocument !== this.pdfDocument) { if (pdfDocument !== this.pdfDocument) {