Ensure that the viewer clears the workerPort option when using "fake" workers
Without this "fake" workers may be ignored in the API, which isn't really what you want when manually providing the `disableWorker=true` hash parameter. (Note that this requires the `pdfBugEnabled` option/preference to be set as well.) Also, after the changes in PR 19810 we can just load the "fake" worker directly in development mode and don't need to manually assign it to the global scope.
This commit is contained in:
parent
d97b65378f
commit
eef1e3e87f
11
web/app.js
11
web/app.js
@ -298,11 +298,12 @@ const PDFViewerApplication = {
|
||||
try {
|
||||
GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc");
|
||||
|
||||
if (typeof PDFJSDev === "undefined") {
|
||||
globalThis.pdfjsWorker = await import("pdfjs/pdf.worker.js");
|
||||
} else {
|
||||
await __raw_import__(PDFWorker.workerSrc);
|
||||
}
|
||||
typeof PDFJSDev === "undefined" // eslint-disable-line no-unused-expressions
|
||||
? await import("pdfjs/pdf.worker.js")
|
||||
: await __raw_import__(PDFWorker.workerSrc);
|
||||
|
||||
// Ensure that the "fake" worker won't be ignored.
|
||||
AppOptions.set("workerPort", null);
|
||||
} catch (ex) {
|
||||
console.error("_parseHashParams:", ex);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user