1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 23:28: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

@ -21,9 +21,9 @@ import {
ProgressBar, RendererType, TextLayerMode
} from './ui_utils';
import {
build, createBlob, getDocument, getFilenameFromUrl, InvalidPDFException,
LinkTarget, MissingPDFException, OPS, PDFJS, PDFWorker, shadow,
UnexpectedResponseException, UNSUPPORTED_FEATURES, version
build, createBlob, getDocument, getFilenameFromUrl, GlobalWorkerOptions,
InvalidPDFException, LinkTarget, MissingPDFException, OPS, PDFJS, PDFWorker,
shadow, UnexpectedResponseException, UNSUPPORTED_FEATURES, version
} from 'pdfjs-lib';
import { CursorTool, PDFCursorTools } from './pdf_cursor_tools';
import { PDFRenderingQueue, RenderingStates } from './pdf_rendering_queue';
@ -54,11 +54,11 @@ function configure(PDFJS) {
PDFJS.imageResourcesPath = './images/';
if (typeof PDFJSDev !== 'undefined' &&
PDFJSDev.test('FIREFOX || MOZCENTRAL || GENERIC || CHROME')) {
PDFJS.workerSrc = '../build/pdf.worker.js';
GlobalWorkerOptions.workerSrc = '../build/pdf.worker.js';
}
if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION')) {
PDFJS.cMapUrl = '../external/bcmaps/';
PDFJS.workerSrc = '../src/worker_loader.js';
GlobalWorkerOptions.workerSrc = '../src/worker_loader.js';
} else {
PDFJS.cMapUrl = '../web/cmaps/';
}