1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Move the workerSrc option from the global PDFJS object and into GlobalWorkerOptions instead

This commit is contained in:
Jonas Jenwald 2018-02-14 14:49:24 +01:00
parent 45adf33187
commit c3c1fc511d
20 changed files with 69 additions and 60 deletions

View file

@ -42,8 +42,8 @@
function initializePDFJS(callback) {
Promise.all([
'pdfjs/display/global',
'pdfjs/display/api',
'pdfjs/display/worker_options',
'pdfjs/display/network',
'pdfjs/display/fetch_stream',
'pdfjs/shared/is_node',
@ -77,9 +77,9 @@ function initializePDFJS(callback) {
'pdfjs-test/unit/util_stream_spec',
].map(function (moduleName) {
return SystemJS.import(moduleName);
})).then(function (modules) {
var displayGlobal = modules[0];
var displayApi = modules[1];
})).then(function(modules) {
var displayApi = modules[0];
const GlobalWorkerOptions = modules[1].GlobalWorkerOptions;
var PDFNetworkStream = modules[2].PDFNetworkStream;
var PDFFetchStream = modules[3].PDFFetchStream;
const isNodeJS = modules[4];
@ -101,7 +101,7 @@ function initializePDFJS(callback) {
}
// Configure the worker.
displayGlobal.PDFJS.workerSrc = '../../build/generic/build/pdf.worker.js';
GlobalWorkerOptions.workerSrc = '../../build/generic/build/pdf.worker.js';
callback();
});