Skip to content

Preview ​

The preview button (the eye) shows a file in a dialog on the same page: no navigation, no new tab. Only types the page can show get the button; clicking a file name still downloads it. Try “Read me.md”, then switch to “Rendered”:

PreviewDemo data
Actions
No files
0 loaded file(s) · 0 B total
md
<FileList base="https://pan.example.com" path="/course" />

Supported types ​

TypeExtensions (some)How
Imagespng, jpg, gif, webp, svg, avif<img>, with rotate and actual size
Video / audiomp4, webm, mov / mp3, m4a, flac, wavThe browser's own player (formats as the browser supports)
Texttxt, md, json, csv, yaml, logs and common codeThe first 1 MB only (Range request), as plain text
Markdown / HTMLmd, markdown / html, htmSource by default; switch to “Rendered”
PDFpdfThe PDF viewer set in OpenList's iframe_previews if any; otherwise the browser's own reader (downloaded and shown as a Blob, up to 50 MB)
Anything else (Office, archives…)—File details and a download button

Source and rendered ​

  • Rendered Markdown uses VitePress' page style and is cleaned by DOMPurify (no scripts, no event attributes). Only http(s) and mailto links are clickable and open in a new tab; relative links become text, relative images show as “[image: alt text]”. The renderer loads only when needed
  • Rendered HTML runs in an iframe with an empty sandbox: no scripts, forms or pop-ups, and no access to the page. Relative resources the page refers to are not loaded
  • The source / rendered choice is remembered on the page

More ​

  • In the dialog, ← / → move through the previewable files of the list; Esc or a click outside closes it
  • Reading text and showing PDFs in the browser need the file address to allow CORS: through OpenList's proxy (/p/) that is OpenList's CORS setting; for direct storage links it is up to the storage. Otherwise the dialog says the file cannot be previewed and offers the download
  • iframe_previews comes from /api/public/settings, the same setting the OpenList web UI uses; the placeholders $url, $e_url, $b_url, $durl and $name mean the same

MIT License