Update PDFViewerApplication._initializeAutoPrint to handle getJSActions returning a Map (PR 21664 follow-up)

This was overlooked in PR 21664, since the code-path in question isn't invoked when scripting is enabled (which is the default value).
This commit is contained in:
Jonas Jenwald 2026-08-05 16:48:43 +02:00
parent 5f181fd8b0
commit 3f5b472db2

View File

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