Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a couple of unnecessary PDFJSDev checks from the viewer #12114

Merged
merged 1 commit into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion web/app_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ const defaultOptions = {
},
pdfBugEnabled: {
/** @type {boolean} */
value: false,
value: typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION"),
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
},
printResolution: {
Expand Down