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:
parent
f8838eb794
commit
ed8b172d12
@ -1952,6 +1952,9 @@ const PDFViewerApplication = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
unbindEvents() {
|
unbindEvents() {
|
||||||
|
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||||
|
throw new Error("Not implemented: unbindEvents");
|
||||||
|
}
|
||||||
const { eventBus, _boundEvents } = this;
|
const { eventBus, _boundEvents } = this;
|
||||||
|
|
||||||
eventBus._off("resize", webViewerResize);
|
eventBus._off("resize", webViewerResize);
|
||||||
@ -2008,6 +2011,9 @@ const PDFViewerApplication = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
unbindWindowEvents() {
|
unbindWindowEvents() {
|
||||||
|
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||||
|
throw new Error("Not implemented: unbindWindowEvents");
|
||||||
|
}
|
||||||
const { _boundEvents } = this;
|
const { _boundEvents } = this;
|
||||||
|
|
||||||
window.removeEventListener("visibilitychange", webViewerVisibilityChange);
|
window.removeEventListener("visibilitychange", webViewerVisibilityChange);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user