From 99c5537a2dcf48a2684c00773057bd9e01e25223 Mon Sep 17 00:00:00 2001 From: Eddy Date: Fri, 17 Apr 2026 13:07:01 +0200 Subject: [PATCH] =?UTF-8?q?PWA:=20Mehr=20Debug-Logs=20f=C3=BCr=20File-View?= =?UTF-8?q?er=20(zeigt=20ob=20PDF.js=20geladen=20ist)=20[deploy]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app.js b/app.js index cfe068f..9f717e7 100644 --- a/app.js +++ b/app.js @@ -1796,13 +1796,22 @@ function openFileViewer({ url, blob, mime }, filename, relpath) { const isImage = (mime || '').startsWith('image/'); const isPdf = (mime || '').includes('pdf') || /\.pdf$/i.test(filename); + console.log('[FILE] openFileViewer:', {filename, mime, isPdf, pdfjs: typeof pdfjs, blobSize: blob.size}); + if (isPdf && typeof pdfjs !== 'undefined') { + console.log('[FILE] → PDF-Viewer aufrufen'); openPdfViewer(blob, filename, relpath); return; } + if (isPdf && typeof pdfjs === 'undefined') { + console.warn('[FILE] PDF.js ist NICHT geladen!'); + showToast('⚠️ PDF.js nicht verfügbar, Download stattdessen', 'error'); + } + if (!isImage) { // Alles außer Bildern + PDFs: Download + console.log('[FILE] → Download-Fallback'); const a = document.createElement('a'); a.href = url; a.download = filename || 'download';