From 43c7e88fa91b6ed4a8f8933b7c52d6eb6dc404db Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Fri, 22 Sep 2023 15:45:02 +0200 Subject: [PATCH] Don't bother trying to unregister the "reporttelemetry" event listener Note that both event-unbind methods are unused in MOZCENTRAL builds; see https://searchfox.org/mozilla-central/rev/48b6992e03fa66f77ac9688ba61c95d31a451bc1/toolkit/components/pdfjs/content/web/viewer.js#1864-1869 --- web/app.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/app.js b/web/app.js index 1cb7369374d00..028f0b1463fc7 100644 --- a/web/app.js +++ b/web/app.js @@ -2007,6 +2007,8 @@ const PDFViewerApplication = { eventBus._on("openfile", webViewerOpenFile); } if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { + // The `unbindEvents` method is unused in MOZCENTRAL builds, + // hence we don't need to unregister these event listeners. eventBus._on( "annotationeditorstateschanged", webViewerAnnotationEditorStatesChanged @@ -2140,9 +2142,6 @@ const PDFViewerApplication = { eventBus._off("fileinputchange", webViewerFileInputChange); eventBus._off("openfile", webViewerOpenFile); } - if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) { - eventBus._off("reporttelemetry", webViewerReportTelemetry); - } _boundEvents.beforePrint = null; _boundEvents.afterPrint = null;