mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Remove SystemJS usage, in development mode, from the worker
Now that https://bugzilla.mozilla.org/show_bug.cgi?id=1247687 has landed in Firefox, we're able to use worker-modules during development :-) This removes the final piece of SystemJS usage from the PDF.js library, thus allowing a fair bit of clean-up, and we now use *only* native `import`/`export` statements everywhere in development mode.
This commit is contained in:
parent
797f8d3dca
commit
95bf9fc17f
12 changed files with 3 additions and 347 deletions
|
@ -2130,12 +2130,9 @@ class PDFWorker {
|
|||
);
|
||||
}
|
||||
|
||||
// Some versions of FF can't create a worker on localhost, see:
|
||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
|
||||
const worker =
|
||||
typeof PDFJSDev === "undefined" &&
|
||||
!workerSrc.endsWith("/build/pdf.worker.js") &&
|
||||
!workerSrc.endsWith("/src/worker_loader.js")
|
||||
!workerSrc.endsWith("/build/pdf.worker.js")
|
||||
? new Worker(workerSrc, { type: "module" })
|
||||
: new Worker(workerSrc);
|
||||
const messageHandler = new MessageHandler("main", "worker", worker);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue