From da9cfe778132c2382e82cc98c592c618ef709307 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 9 Aug 2024 16:46:08 +0200 Subject: [PATCH] Check that `AbortSignal.any()` is supported in `PDFViewer` too (PR 18586 follow-up) Without this patch the viewer may break on load, since the check added in PR 18586 only applies to the toolbar. --- web/pdf_viewer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/pdf_viewer.js b/web/pdf_viewer.js index 69374c29344d4..c53678ba365d3 100644 --- a/web/pdf_viewer.js +++ b/web/pdf_viewer.js @@ -880,7 +880,11 @@ class PDFViewer { viewer.before(element); } - if (annotationEditorMode !== AnnotationEditorType.DISABLE) { + if ( + ((typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) || + typeof AbortSignal.any === "function") && + annotationEditorMode !== AnnotationEditorType.DISABLE + ) { const mode = annotationEditorMode; if (pdfDocument.isPureXfa) {