Merge pull request #12114 from Snuffleupagus/viewer-PDFJSDev-cleanup

Remove a couple of unnecessary `PDFJSDev` checks from the viewer
This commit is contained in:
Tim van der Meij 2020-07-23 23:47:26 +02:00 committed by GitHub
commit 7b0c52fdfe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 11 deletions

View File

@ -299,11 +299,7 @@ const PDFViewerApplication = {
* @private
*/
async _parseHashParameters() {
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("PRODUCTION") &&
!AppOptions.get("pdfBugEnabled")
) {
if (!AppOptions.get("pdfBugEnabled")) {
return undefined;
}
const hash = document.location.hash.substring(1);
@ -1931,11 +1927,7 @@ function webViewerInitialized() {
appConfig.secondaryToolbar.openFileButton.setAttribute("hidden", "true");
}
if (
(typeof PDFJSDev === "undefined" ||
PDFJSDev.test("MOZCENTRAL || GENERIC")) &&
!PDFViewerApplication.supportsDocumentFonts
) {
if (!PDFViewerApplication.supportsDocumentFonts) {
AppOptions.set("disableFontFace", true);
PDFViewerApplication.l10n
.get(

View File

@ -112,7 +112,7 @@ const defaultOptions = {
},
pdfBugEnabled: {
/** @type {boolean} */
value: false,
value: typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION"),
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
},
printResolution: {