Merge pull request #17255 from Snuffleupagus/issue-17228
Ensure that the viewer waits for the library to complete loading (issue 17228)
This commit is contained in:
commit
290b483167
@ -422,7 +422,7 @@ function tweakWebpackOutput(jsName) {
|
|||||||
case " __webpack_exports__ = {};":
|
case " __webpack_exports__ = {};":
|
||||||
return ` __webpack_exports__ = globalThis.${jsName} = {};`;
|
return ` __webpack_exports__ = globalThis.${jsName} = {};`;
|
||||||
case " __webpack_exports__ = await __webpack_exports__;":
|
case " __webpack_exports__ = await __webpack_exports__;":
|
||||||
return ` __webpack_exports__ = globalThis.${jsName} = await __webpack_exports__;`;
|
return ` __webpack_exports__ = globalThis.${jsName} = await (globalThis.${jsName}Promise = __webpack_exports__);`;
|
||||||
}
|
}
|
||||||
return match;
|
return match;
|
||||||
});
|
});
|
||||||
|
@ -13,6 +13,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Ensure that the viewer waits for the library to complete loading,
|
||||||
|
// to avoid breaking e.g. the standalone viewer components (see issue 17228).
|
||||||
|
if (
|
||||||
|
(typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) &&
|
||||||
|
!globalThis.pdfjsLib
|
||||||
|
) {
|
||||||
|
await globalThis.pdfjsLibPromise;
|
||||||
|
}
|
||||||
|
|
||||||
const {
|
const {
|
||||||
AbortException,
|
AbortException,
|
||||||
AnnotationEditorLayer,
|
AnnotationEditorLayer,
|
||||||
|
Loading…
Reference in New Issue
Block a user