diff --git a/web/app.js b/web/app.js index 9b5667f01..12af58ebe 100644 --- a/web/app.js +++ b/web/app.js @@ -1855,7 +1855,7 @@ const PDFViewerApplication = { console.warn("Warning: JavaScript support is not enabled"); // Hack to support auto printing. - for (const name in jsActions) { + for (const [name, actions] of jsActions) { if (triggerAutoPrint) { break; } @@ -1867,7 +1867,7 @@ const PDFViewerApplication = { case "DidPrint": continue; } - triggerAutoPrint = jsActions[name].some(js => AutoPrintRegExp.test(js)); + triggerAutoPrint = actions.some(js => AutoPrintRegExp.test(js)); } }