Stop bundling the openFile-buttons in the MOZCENTRAL build

Note how both of the openFile-buttons are always hidden during viewer initialization in the MOZCENTRAL build, i.e. the *built-in* Firefox PDF Viewer. Despite that we still include HTML, CSS, and JavaScript code for these buttons in the build.

This patch *reduces* the size of the `gulp mozcentral` output by `1679` bytes, which isn't a lot but still cannot hurt.
This commit is contained in:
Jonas Jenwald 2022-04-25 10:06:47 +02:00
parent 2be19e828f
commit b04c373362
7 changed files with 32 additions and 9 deletions

View file

@ -65,7 +65,6 @@ class SecondaryToolbar {
eventName: "presentationmode",
close: true,
},
{ element: options.openFileButton, eventName: "openfile", close: true },
{ element: options.printButton, eventName: "print", close: true },
{ element: options.downloadButton, eventName: "download", close: true },
{ element: options.viewBookmarkButton, eventName: null, close: true },
@ -141,6 +140,13 @@ class SecondaryToolbar {
close: true,
},
];
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
this.buttons.push({
element: options.openFileButton,
eventName: "openfile",
close: true,
});
}
this.items = {
firstPage: options.firstPageButton,
lastPage: options.lastPageButton,