mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-21 14:22:19 +02:00
fix(email): replace html2pdf with Print / save PDF and harden EML export
SAN-157 removed the html2pdf client library. The PDF export code added in the original PR commit referenced the deleted library and would fail at runtime. Replace the html2pdf-based _downloadSelectedEmailPdf with a browser Print / save PDF workflow using a sandboxed iframe and window.print(), matching the established pattern in document.js and compare/index.js. Changes: - Replace _loadEmailHtml2Pdf and _downloadSelectedEmailPdf with _printSelectedEmails using a sandboxed iframe + contentWindow.print() - Update menu label from 'PDF' to 'Print / save PDF' - Add 512 MiB total size cap to /messages-download-bulk to prevent unbounded memory growth when exporting many large messages - Update test assertions to verify the browser print pattern and confirm html2pdf is not referenced - Add regression tests for size cap, selection count validation, non-numeric UID rejection, and partial batch failure accounting
This commit is contained in:
@@ -619,7 +619,7 @@ export function _showBulkActionsMenu(anchor) {
|
||||
dropdown.appendChild(divider);
|
||||
const options = [
|
||||
{ label: 'Email file (.eml)', icon: _emailIco, action: _exportSelectedEmails },
|
||||
{ label: 'PDF', icon: _pdfIco, action: _exportSelectedEmailPdf },
|
||||
{ label: 'Print / save PDF', icon: _pdfIco, action: _exportSelectedEmailPdf },
|
||||
];
|
||||
for (const option of options) {
|
||||
const child = document.createElement('div');
|
||||
|
||||
Reference in New Issue
Block a user