Tweak the useWorkerFetch
default value checks (PR 15879 follow-up)
Currently we accidentally accept `cMapUrl` and `standardFontDataUrl` parameters that are empty strings or `null`, since e.g. `new URL(null, document.baseURI)` doesn't throw, when validating the `useWorkerFetch` parameter via the `isValidFetchUrl` helper function. Please note that we are currently failing gracefully in this case, as intended, however the warning-messages printed in the console are perhaps less helpful without this patch.
This commit is contained in:
parent
611acf52c4
commit
c09bd5568c
@ -316,6 +316,8 @@ function getDocument(src) {
|
|||||||
: (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
: (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||||
(CMapReaderFactory === DOMCMapReaderFactory &&
|
(CMapReaderFactory === DOMCMapReaderFactory &&
|
||||||
StandardFontDataFactory === DOMStandardFontDataFactory &&
|
StandardFontDataFactory === DOMStandardFontDataFactory &&
|
||||||
|
cMapUrl &&
|
||||||
|
standardFontDataUrl &&
|
||||||
isValidFetchUrl(cMapUrl, document.baseURI) &&
|
isValidFetchUrl(cMapUrl, document.baseURI) &&
|
||||||
isValidFetchUrl(standardFontDataUrl, document.baseURI));
|
isValidFetchUrl(standardFontDataUrl, document.baseURI));
|
||||||
const canvasFactory =
|
const canvasFactory =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user