Use a bit more optional chaining in the viewer
This commit is contained in:
parent
27e738dff9
commit
bb25b6dec5
10
web/app.js
10
web/app.js
@ -2047,9 +2047,8 @@ const PDFViewerApplication = {
|
||||
* @private
|
||||
*/
|
||||
_unblockDocumentLoadEvent() {
|
||||
if (document.blockUnblockOnload) {
|
||||
document.blockUnblockOnload(false);
|
||||
}
|
||||
document.blockUnblockOnload?.(false);
|
||||
|
||||
// Ensure that this method is only ever run once.
|
||||
this._unblockDocumentLoadEvent = () => {};
|
||||
},
|
||||
@ -2112,9 +2111,8 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
||||
}
|
||||
|
||||
async function loadFakeWorker() {
|
||||
if (!GlobalWorkerOptions.workerSrc) {
|
||||
GlobalWorkerOptions.workerSrc = AppOptions.get("workerSrc");
|
||||
}
|
||||
GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc");
|
||||
|
||||
if (typeof PDFJSDev === "undefined" || !PDFJSDev.test("PRODUCTION")) {
|
||||
window.pdfjsWorker = await import("pdfjs/core/worker.js");
|
||||
return;
|
||||
|
@ -243,9 +243,7 @@ function webViewerLoad() {
|
||||
|
||||
// Block the "load" event until all pages are loaded, to ensure that printing
|
||||
// works in Firefox; see https://bugzilla.mozilla.org/show_bug.cgi?id=1618553
|
||||
if (document.blockUnblockOnload) {
|
||||
document.blockUnblockOnload(true);
|
||||
}
|
||||
document.blockUnblockOnload?.(true);
|
||||
|
||||
if (
|
||||
document.readyState === "interactive" ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user