Ensure that the useWorkerFetch fallback value is always a boolean
If either of the factory-urls are missing or invalid, the fallback value would currently become `useWorkerFetch === null`. While that is obviously a falsy value, which means that the code still works as intended, we should ensure that this is consistent.
This commit is contained in:
parent
3f15e0c469
commit
06e4580f8b
@ -331,7 +331,8 @@ function getDocument(src = {}) {
|
|||||||
typeof src.useWorkerFetch === "boolean"
|
typeof src.useWorkerFetch === "boolean"
|
||||||
? src.useWorkerFetch
|
? src.useWorkerFetch
|
||||||
: (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
: (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||||
(CMapReaderFactory === DOMCMapReaderFactory &&
|
!!(
|
||||||
|
CMapReaderFactory === DOMCMapReaderFactory &&
|
||||||
StandardFontDataFactory === DOMStandardFontDataFactory &&
|
StandardFontDataFactory === DOMStandardFontDataFactory &&
|
||||||
WasmFactory === DOMWasmFactory &&
|
WasmFactory === DOMWasmFactory &&
|
||||||
cMapUrl &&
|
cMapUrl &&
|
||||||
@ -339,7 +340,8 @@ function getDocument(src = {}) {
|
|||||||
wasmUrl &&
|
wasmUrl &&
|
||||||
isValidFetchUrl(cMapUrl, document.baseURI) &&
|
isValidFetchUrl(cMapUrl, document.baseURI) &&
|
||||||
isValidFetchUrl(standardFontDataUrl, document.baseURI) &&
|
isValidFetchUrl(standardFontDataUrl, document.baseURI) &&
|
||||||
isValidFetchUrl(wasmUrl, document.baseURI));
|
isValidFetchUrl(wasmUrl, document.baseURI)
|
||||||
|
);
|
||||||
|
|
||||||
// Parameters only intended for development/testing purposes.
|
// Parameters only intended for development/testing purposes.
|
||||||
const styleElement =
|
const styleElement =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user