mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
SingleFile cannot inline resources added to the DOM at before-capture time — only resources tracked during the page's initial load cycle get embedded. Article images in Readability output fall into this gap when the page framework has already resolved their lazy src to a CDN URL that isn't in SingleFile's resource cache for the new DOM elements. Fix in three parts: - Browser script: after body.innerHTML = article.content, stamp data-archivr-src=<absolute-proxy-url> on any image whose src is not an already-inlined large data URI. Remove loading attr. Don't touch src (let SingleFile try; Rust handles the rest). - Rust (save_with): after SingleFile writes the file and before hashing, call inline_archivr_img_srcs() to scan for data-archivr-src markers. - inline_archivr_img_srcs(): fetches each marked URL with blocking reqwest (10 s timeout, 5 redirects, image/* Content-Type guard, 20 MiB cap), base64-encodes, replaces src with the data URI, and removes the marker attr. Non-fatal — fetch failures are logged. Also: Freedium UI cleanup now removes footer, #progress, and empty data-nosnippet wrappers in addition to the existing nav/toaster removal. |
||
|---|---|---|
| .. | ||
| archivr-cli | ||
| archivr-core | ||
| archivr-server | ||