Stop bundling PDFViewerApplication.{unbindEvents, unbindWindowEvents} in MOZCENTRAL builds

These methods are completely unused in the Firefox PDF Viewer, and were only added to supplement the `PDFViewerApplication.{bindEvents, bindWindowEvents}`-methods since third-party implementations may apparently need to remove event listeners (see PR 8525).
However, in the MOZCENTRAL build that's just dead code and this patch reduces the size of the *built* `web/viewer.js`-file by `~3.5` kB.
This commit is contained in:
Jonas Jenwald 2022-05-07 15:48:54 +02:00
parent f8838eb794
commit ed8b172d12

View File

@ -1952,6 +1952,9 @@ const PDFViewerApplication = {
},
unbindEvents() {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
throw new Error("Not implemented: unbindEvents");
}
const { eventBus, _boundEvents } = this;
eventBus._off("resize", webViewerResize);
@ -2008,6 +2011,9 @@ const PDFViewerApplication = {
},
unbindWindowEvents() {
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
throw new Error("Not implemented: unbindWindowEvents");
}
const { _boundEvents } = this;
window.removeEventListener("visibilitychange", webViewerVisibilityChange);