mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #11489 from Snuffleupagus/rm-FIREFOX-define
Remove the `FIREFOX` build flag, since it's completely unused and simplify a couple of `PDFJSDev` checks
This commit is contained in:
commit
d2d9441373
18 changed files with 40 additions and 75 deletions
|
@ -1345,7 +1345,10 @@ var JpegImage = (function JpegImageClosure() {
|
|||
},
|
||||
|
||||
getData({ width, height, forceRGB = false, isSourcePDF = false }) {
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("TESTING && !LIB")) {
|
||||
if (
|
||||
typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || TESTING")
|
||||
) {
|
||||
assert(
|
||||
isSourcePDF === true,
|
||||
'JpegImage.getData: Unexpected "isSourcePDF" value for PDF files.'
|
||||
|
|
|
@ -1639,7 +1639,6 @@ const PDFWorker = (function PDFWorkerClosure() {
|
|||
return worker.WorkerMessageHandler;
|
||||
}
|
||||
if (
|
||||
typeof PDFJSDev !== "undefined" &&
|
||||
PDFJSDev.test("GENERIC") &&
|
||||
isNodeJS &&
|
||||
// eslint-disable-next-line no-undef
|
||||
|
|
|
@ -25,10 +25,9 @@ import {
|
|||
validateRangeRequestCapabilities,
|
||||
} from "./network_utils.js";
|
||||
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("FIREFOX || MOZCENTRAL")) {
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
throw new Error(
|
||||
'Module "./network" shall not ' +
|
||||
"be used with FIREFOX or MOZCENTRAL build."
|
||||
'Module "./network.js" shall not be used with MOZCENTRAL builds.'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -601,7 +601,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
|
|||
let canvas = document.createElement("canvas");
|
||||
if (
|
||||
typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("FIREFOX || MOZCENTRAL || GENERIC")
|
||||
PDFJSDev.test("MOZCENTRAL || GENERIC")
|
||||
) {
|
||||
canvas.mozOpaque = true;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||
return new PDFNetworkStream(params);
|
||||
});
|
||||
}
|
||||
} else if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("CHROME")) {
|
||||
} else if (PDFJSDev.test("CHROME")) {
|
||||
let PDFNetworkStream = require("./display/network.js").PDFNetworkStream;
|
||||
let PDFFetchStream;
|
||||
let isChromeWithFetchCredentials = function() {
|
||||
|
|
|
@ -51,9 +51,10 @@ function wrapReason(reason) {
|
|||
(typeof reason === "object" && reason !== null),
|
||||
'wrapReason: Expected "reason" to be a (possibly cloned) Error.'
|
||||
);
|
||||
}
|
||||
if (typeof reason !== "object" || reason === null) {
|
||||
return reason;
|
||||
} else {
|
||||
if (typeof reason !== "object" || reason === null) {
|
||||
return reason;
|
||||
}
|
||||
}
|
||||
switch (reason.name) {
|
||||
case "AbortException":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue