From 6d6c71c07becf442a27d78eaed29408972ec44a6 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 1 Oct 2024 17:54:22 +0200 Subject: [PATCH] Always set `AppOptions.eventBus`, regardless of build, to make local testing easier --- web/app.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/web/app.js b/web/app.js index d5d61b82b7e2a6..2a56c8916bb963 100644 --- a/web/app.js +++ b/web/app.js @@ -376,18 +376,16 @@ const PDFViewerApplication = { async _initializeViewerComponents() { const { appConfig, externalServices, l10n } = this; - let eventBus; - if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { - eventBus = AppOptions.eventBus = new FirefoxEventBus( - AppOptions.get("allowedGlobalEvents"), - externalServices, - AppOptions.get("isInAutomation") - ); - } else { - eventBus = new EventBus(); - } + const eventBus = + typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL") + ? new FirefoxEventBus( + AppOptions.get("allowedGlobalEvents"), + externalServices, + AppOptions.get("isInAutomation") + ) + : new EventBus(); + this.eventBus = AppOptions.eventBus = eventBus; this.mlManager?.setEventBus(eventBus, this._globalAbortController.signal); - this.eventBus = eventBus; this.overlayManager = new OverlayManager();