From ae4dfc48ccfc673c611a8a390c86f1de0ab35afd Mon Sep 17 00:00:00 2001 From: jubnl Date: Fri, 17 Apr 2026 20:22:31 +0200 Subject: [PATCH] fix(pdf): add allow-scripts to iframe sandbox to suppress CSP warning --- client/src/components/PDF/JourneyBookPDF.tsx | 2 +- client/src/components/PDF/TripPDF.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/PDF/JourneyBookPDF.tsx b/client/src/components/PDF/JourneyBookPDF.tsx index bdf4133a..97f30388 100644 --- a/client/src/components/PDF/JourneyBookPDF.tsx +++ b/client/src/components/PDF/JourneyBookPDF.tsx @@ -308,7 +308,7 @@ export async function downloadJourneyBookPDF(journey: JourneyDetail) { const iframe = document.createElement('iframe') iframe.style.cssText = 'flex:1;width:100%;border:none;' - iframe.sandbox = 'allow-same-origin allow-modals' + iframe.sandbox = 'allow-same-origin allow-modals allow-scripts' iframe.srcdoc = html card.appendChild(header) diff --git a/client/src/components/PDF/TripPDF.tsx b/client/src/components/PDF/TripPDF.tsx index 1491a4cf..e02939e5 100644 --- a/client/src/components/PDF/TripPDF.tsx +++ b/client/src/components/PDF/TripPDF.tsx @@ -521,7 +521,7 @@ ${daysHtml} const iframe = document.createElement('iframe') iframe.style.cssText = 'flex:1;width:100%;border:none;' - iframe.sandbox = 'allow-same-origin allow-modals' + iframe.sandbox = 'allow-same-origin allow-modals allow-scripts' iframe.srcdoc = html card.appendChild(header)