mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Ensure that the viewer waits for the library to complete loading (issue 17228)
This should *hopefully* fix 17228, by tweaking the build scripts to give the GENERIC viewer something to await to avoid breaking third-party users of the standalone viewer components.
This commit is contained in:
parent
1b88aad0db
commit
823d375b8b
2 changed files with 10 additions and 1 deletions
|
@ -13,6 +13,15 @@
|
|||
* 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 {
|
||||
AbortException,
|
||||
AnnotationEditorLayer,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue