1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Simplify, and tweak, a couple of PDFJSDev checks

This removes a couple of, thanks to preceeding code, unnecessary `typeof PDFJSDev` checks, and also fixes a couple of incorrectly implemented (my fault) checks intended for `TESTING` builds.
This commit is contained in:
Jonas Jenwald 2020-01-08 15:33:11 +01:00
parent 7322a24ce4
commit a39943554a
6 changed files with 11 additions and 11 deletions

View file

@ -731,10 +731,7 @@ const PDFViewerApplication = {
if (key === "docBaseUrl" && !value) {
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
value = document.URL.split("#")[0];
} else if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("MOZCENTRAL || CHROME")
) {
} else if (PDFJSDev.test("MOZCENTRAL || CHROME")) {
value = this.baseUrl;
}
}

View file

@ -745,7 +745,7 @@ function waitOnEventOrTimeout({ target, name, delay = 0 }) {
const animationStarted = new Promise(function(resolve) {
if (
typeof PDFJSDev !== "undefined" &&
PDFJSDev.test("LIB") &&
PDFJSDev.test("LIB && TESTING") &&
typeof window === "undefined"
) {
// Prevent "ReferenceError: window is not defined" errors when running the