1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-19 06:38:07 +02:00

Merge pull request #19499 from Snuffleupagus/useWorkerFetch-ensure-boolean

Ensure that the `useWorkerFetch` fallback value is always a boolean
This commit is contained in:
Tim van der Meij 2025-02-16 14:50:29 +01:00 committed by GitHub
commit 33c97570f5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -331,7 +331,8 @@ function getDocument(src = {}) {
typeof src.useWorkerFetch === "boolean"
? src.useWorkerFetch
: (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
(CMapReaderFactory === DOMCMapReaderFactory &&
!!(
CMapReaderFactory === DOMCMapReaderFactory &&
StandardFontDataFactory === DOMStandardFontDataFactory &&
WasmFactory === DOMWasmFactory &&
cMapUrl &&
@ -339,7 +340,8 @@ function getDocument(src = {}) {
wasmUrl &&
isValidFetchUrl(cMapUrl, document.baseURI) &&
isValidFetchUrl(standardFontDataUrl, document.baseURI) &&
isValidFetchUrl(wasmUrl, document.baseURI));
isValidFetchUrl(wasmUrl, document.baseURI)
);
// Parameters only intended for development/testing purposes.
const styleElement =