1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +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:
Jonas Jenwald 2020-11-01 23:06:40 +01:00
parent 797f8d3dca
commit 95bf9fc17f
12 changed files with 3 additions and 347 deletions

View file

@ -309,12 +309,7 @@ const PDFViewerApplication = {
const { mainContainer, viewerContainer } = this.appConfig,
params = parseQueryString(hash);
if (
typeof PDFJSDev === "undefined" &&
params.get("workermodules") === "true"
) {
AppOptions.set("workerSrc", "../src/pdf.worker.js");
} else if (params.get("disableworker") === "true") {
if (params.get("disableworker") === "true") {
try {
await loadFakeWorker();
} catch (ex) {

View file

@ -292,7 +292,7 @@ const defaultOptions = {
value:
// eslint-disable-next-line no-nested-ternary
typeof PDFJSDev === "undefined"
? "../src/worker_loader.js"
? "../src/pdf.worker.js"
: PDFJSDev.test("MOZCENTRAL")
? "resource://pdf.js/build/pdf.worker.js"
: "../build/pdf.worker.js",