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

@ -88,7 +88,10 @@ function getViewerConfiguration() {
zoomIn: document.getElementById("zoomIn"),
zoomOut: document.getElementById("zoomOut"),
viewFind: document.getElementById("viewFind"),
openFile: document.getElementById("openFile"),
openFile:
typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")
? document.getElementById("openFile")
: null,
print: document.getElementById("print"),
presentationModeButton: document.getElementById("presentationMode"),
download: document.getElementById("download"),
@ -103,7 +106,10 @@ function getViewerConfiguration() {
presentationModeButton: document.getElementById(
"secondaryPresentationMode"
),
openFileButton: document.getElementById("secondaryOpenFile"),
openFileButton:
typeof PDFJSDev === "undefined" || !PDFJSDev.test("MOZCENTRAL")
? document.getElementById("secondaryOpenFile")
: null,
printButton: document.getElementById("secondaryPrint"),
downloadButton: document.getElementById("secondaryDownload"),
viewBookmarkButton: document.getElementById("secondaryViewBookmark"),