From 3f5b472db230b4254cac6eb49ebeb0d2bf02801e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 5 Aug 2026 16:48:43 +0200 Subject: [PATCH] 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). --- web/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)); } }