mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16: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:
parent
797f8d3dca
commit
95bf9fc17f
12 changed files with 3 additions and 347 deletions
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017,
|
||||
},
|
||||
|
||||
"extends": [
|
||||
"../../.eslintrc"
|
||||
],
|
||||
|
||||
"env": {
|
||||
"es2017": true,
|
||||
},
|
||||
}
|
|
@ -12,7 +12,6 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* no-babel-preset */
|
||||
|
||||
import { getLookupTableFactory } from "./core_utils.js";
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017,
|
||||
},
|
||||
|
||||
"extends": [
|
||||
"../../.eslintrc"
|
||||
],
|
||||
|
||||
"env": {
|
||||
"es2017": true,
|
||||
},
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/* Copyright 2012 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
// Patch importScripts to work around a bug in WebKit and Chrome 48-.
|
||||
// See https://crbug.com/572225 and https://webkit.org/b/153317.
|
||||
self.importScripts = (function (importScripts) {
|
||||
return function () {
|
||||
setTimeout(function () {}, 0);
|
||||
return importScripts.apply(this, arguments);
|
||||
};
|
||||
})(importScripts);
|
||||
|
||||
importScripts("../node_modules/systemjs/dist/system.js");
|
||||
importScripts("../systemjs.config.js");
|
||||
|
||||
SystemJS.import("pdfjs/core/worker.js").then(function () {
|
||||
// Worker is loaded at this point.
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue