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

@ -62,7 +62,6 @@ class Toolbar {
{ element: options.next, eventName: "nextpage" },
{ element: options.zoomIn, eventName: "zoomin" },
{ element: options.zoomOut, eventName: "zoomout" },
{ element: options.openFile, eventName: "openfile" },
{ element: options.print, eventName: "print" },
{
element: options.presentationModeButton,
@ -71,6 +70,9 @@ class Toolbar {
{ element: options.download, eventName: "download" },
{ element: options.viewBookmark, eventName: null },
];
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")) {
this.buttons.push({ element: options.openFile, eventName: "openfile" });
}
this.items = {
numPages: options.numPages,
pageNumber: options.pageNumber,