Inline the loadFakeWorker function at its only call-site in web/app.js
Given that this is a debug-only, and fairly short, function we can just inline the code.
This commit is contained in:
parent
4a8d742592
commit
ba8c620e4b
18
web/app.js
18
web/app.js
@ -267,7 +267,13 @@ const PDFViewerApplication = {
|
|||||||
|
|
||||||
if (params.get("disableworker") === "true") {
|
if (params.get("disableworker") === "true") {
|
||||||
try {
|
try {
|
||||||
await loadFakeWorker();
|
GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc");
|
||||||
|
|
||||||
|
if (typeof PDFJSDev === "undefined") {
|
||||||
|
globalThis.pdfjsWorker = await import("pdfjs/pdf.worker.js");
|
||||||
|
} else {
|
||||||
|
await __non_webpack_import__(PDFWorker.workerSrc);
|
||||||
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
console.error(`_parseHashParams: "${ex.message}".`);
|
console.error(`_parseHashParams: "${ex.message}".`);
|
||||||
}
|
}
|
||||||
@ -2164,16 +2170,6 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadFakeWorker() {
|
|
||||||
GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc");
|
|
||||||
|
|
||||||
if (typeof PDFJSDev === "undefined") {
|
|
||||||
globalThis.pdfjsWorker = await import("pdfjs/pdf.worker.js");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await __non_webpack_import__(PDFWorker.workerSrc);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadPDFBug(self) {
|
async function loadPDFBug(self) {
|
||||||
const { PDFBug } =
|
const { PDFBug } =
|
||||||
typeof PDFJSDev === "undefined"
|
typeof PDFJSDev === "undefined"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user