@@ -5548,9 +5548,28 @@ window.app.modules.filtering = {
*/
async function showFilePreview(file) {
const ext = file.extension.toLowerCase();
-
+
try {
- const url = await getFileBlobUrl(file);
+ // For HTML preview, prefer the file's real server URL over a
+ // blob URL when available (zddc-server-backed archives have
+ // file.url set; local FileSystemAccessAPI mode doesn't).
+ //
+ // Why it matters: HTML files in an archive often link to
+ // sibling/parent paths via relative URLs — e.g.
+ // ../.archive/.html — which zddc-server intercepts
+ // and resolves. From a blob: URL the relative resolution
+ // produces blob:.../.archive/X.html, which never reaches the
+ // server. Loading the iframe from the actual https://zddc.../
+ // URL means relative links resolve back to the server and the
+ // .archive interception fires as designed.
+ //
+ // Other types (pdf, images rendered via canvas / iframe etc.)
+ // are content-only — they don't depend on relative URLs — so
+ // a blob URL is fine.
+ const isHtml = ext === 'html' || ext === 'htm';
+ const url = (isHtml && file.url)
+ ? file.url
+ : await getFileBlobUrl(file);
// Mirror the parent window's theme in the popup
const parentTheme = document.documentElement.getAttribute('data-theme') || '';
@@ -5714,7 +5733,7 @@ window.app.modules.filtering = {
${(ext === 'pdf' || ext === 'html' || ext === 'htm')
- ? ''
+ ? ''
: '