mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Move the workerPort
from the global PDFJS
object and into GlobalWorkerOptions
instead
This commit is contained in:
parent
003bd4044b
commit
45adf33187
4 changed files with 4 additions and 10 deletions
|
@ -27,6 +27,7 @@ import {
|
|||
import { FontFaceObject, FontLoader } from './font_loader';
|
||||
import { CanvasGraphics } from './canvas';
|
||||
import globalScope from '../shared/global_scope';
|
||||
import { GlobalWorkerOptions } from './worker_options';
|
||||
import { Metadata } from './metadata';
|
||||
import { PDFDataTransportStream } from './transport_stream';
|
||||
import { WebGLContext } from './webgl';
|
||||
|
@ -240,8 +241,8 @@ function getDocument(src) {
|
|||
|
||||
if (!worker) {
|
||||
// Worker was not provided -- creating and owning our own. If message port
|
||||
// is specified in global settings, using it.
|
||||
var workerPort = getDefaultSetting('workerPort');
|
||||
// is specified in global worker options, using it.
|
||||
let workerPort = GlobalWorkerOptions.workerPort;
|
||||
worker = workerPort ? PDFWorker.fromPort(workerPort) : new PDFWorker();
|
||||
task._worker = worker;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue