mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 09:08:07 +02:00
[api-minor] Re-factor how the useWorkerFetch
option is used internally
With the recently added OpenJPEG no-wasm fallback we need to send the `wasmUrl` option to the worker-thread *regardless* of the value of the `useWorkerFetch` option, since the fallback won't work if we don't have a URL to `import` it from. For consistency the code is re-factored to always send the factory-urls to the worker-thread, and simply check the `useWorkerFetch` option there instead. Also, as a follow-up to PR 19525, introduce a new `useWasm` option that can be used in e.g. browser-tests to forcibly disable WebAssembly usage.
This commit is contained in:
parent
6d3bb47655
commit
641e2f506e
5 changed files with 29 additions and 20 deletions
|
@ -638,10 +638,11 @@ class Driver {
|
|||
password: task.password,
|
||||
cMapUrl: CMAP_URL,
|
||||
standardFontDataUrl: STANDARD_FONT_DATA_URL,
|
||||
wasmUrl: task.noWasm ? null : WASM_URL,
|
||||
wasmUrl: WASM_URL,
|
||||
disableAutoFetch: !task.enableAutoFetch,
|
||||
pdfBug: true,
|
||||
useSystemFonts: task.useSystemFonts,
|
||||
useWasm: task.useWasm,
|
||||
useWorkerFetch: task.useWorkerFetch,
|
||||
enableXfa: task.enableXfa,
|
||||
isOffscreenCanvasSupported,
|
||||
|
|
|
@ -6422,9 +6422,9 @@
|
|||
"id": "issue19326_nowasm",
|
||||
"file": "pdfs/issue19326.pdf",
|
||||
"md5": "b4d937017daf439a6318501428e0c6ba",
|
||||
"noWasm": true,
|
||||
"rounds": 1,
|
||||
"type": "eq"
|
||||
"type": "eq",
|
||||
"useWasm": false
|
||||
},
|
||||
{
|
||||
"id": "issue19326_main_thread_fetch",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue