mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Refactor how the default viewer handles the worker options, by making use of AppOptions
instead of the global PDFJS
object
This commit is contained in:
parent
57165afb08
commit
b0956a5d91
2 changed files with 37 additions and 8 deletions
|
@ -127,6 +127,29 @@ const defaultOptions = {
|
|||
value: false,
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
|
||||
postMessageTransfers: {
|
||||
/** @type {boolean} */
|
||||
value: true,
|
||||
kind: OptionKind.API,
|
||||
},
|
||||
verbosity: {
|
||||
/** @type {number} */
|
||||
value: 1,
|
||||
kind: OptionKind.API,
|
||||
},
|
||||
|
||||
workerPort: {
|
||||
/** @type {Object} */
|
||||
value: null,
|
||||
kind: OptionKind.WORKER,
|
||||
},
|
||||
workerSrc: {
|
||||
/** @type {string} */
|
||||
value: (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('PRODUCTION') ?
|
||||
'../src/worker_loader.js' : '../build/pdf.worker.js'),
|
||||
kind: OptionKind.WORKER,
|
||||
},
|
||||
};
|
||||
|
||||
const userOptions = Object.create(null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue