mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
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
1 changed files with 7 additions and 11 deletions
18
web/app.js
18
web/app.js
|
@ -267,7 +267,13 @@ const PDFViewerApplication = {
|
|||
|
||||
if (params.get("disableworker") === "true") {
|
||||
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) {
|
||||
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) {
|
||||
const { PDFBug } =
|
||||
typeof PDFJSDev === "undefined"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue