Merge pull request #15879 from Snuffleupagus/useWorkerFetch-defaults
[api-minor] Improve the `useWorkerFetch` default value checks
This commit is contained in:
commit
b428824269
@ -47,6 +47,7 @@ import {
|
|||||||
DOMCMapReaderFactory,
|
DOMCMapReaderFactory,
|
||||||
DOMStandardFontDataFactory,
|
DOMStandardFontDataFactory,
|
||||||
isDataScheme,
|
isDataScheme,
|
||||||
|
isValidFetchUrl,
|
||||||
loadScript,
|
loadScript,
|
||||||
PageViewport,
|
PageViewport,
|
||||||
RenderingCancelledException,
|
RenderingCancelledException,
|
||||||
@ -363,8 +364,11 @@ function getDocument(src) {
|
|||||||
}
|
}
|
||||||
if (typeof params.useWorkerFetch !== "boolean") {
|
if (typeof params.useWorkerFetch !== "boolean") {
|
||||||
params.useWorkerFetch =
|
params.useWorkerFetch =
|
||||||
params.CMapReaderFactory === DOMCMapReaderFactory &&
|
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||||
params.StandardFontDataFactory === DOMStandardFontDataFactory;
|
(params.CMapReaderFactory === DOMCMapReaderFactory &&
|
||||||
|
params.StandardFontDataFactory === DOMStandardFontDataFactory &&
|
||||||
|
isValidFetchUrl(params.cMapUrl, document.baseURI) &&
|
||||||
|
isValidFetchUrl(params.standardFontDataUrl, document.baseURI));
|
||||||
}
|
}
|
||||||
if (typeof params.isEvalSupported !== "boolean") {
|
if (typeof params.isEvalSupported !== "boolean") {
|
||||||
params.isEvalSupported = true;
|
params.isEvalSupported = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user