From 852cc45956bf26cf3e49bafb9bef15413df0d763 Mon Sep 17 00:00:00 2001 From: TheGeneralist <180094941+thegeneralist01@users.noreply.github.com> Date: Wed, 24 Jun 2026 21:15:36 +0200 Subject: [PATCH] fix(singlefile): disable CSS stripping and script blocking for full render fidelity Defaults that were destroying CSS fidelity: - --remove-unused-styles=true: strips CSS nesting rules (site uses & selector) and any rule targeting JS-applied classes - --remove-alternative-medias=true: deletes @media blocks that don't match the capture viewport, breaking responsive layout - --block-scripts=true: prevents JS from applying classes before CSS snapshot All three now set to false. --- crates/archivr-core/src/downloader/singlefile.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/archivr-core/src/downloader/singlefile.rs b/crates/archivr-core/src/downloader/singlefile.rs index c31328f..9ac14bd 100644 --- a/crates/archivr-core/src/downloader/singlefile.rs +++ b/crates/archivr-core/src/downloader/singlefile.rs @@ -54,6 +54,13 @@ fn save_with( .arg(format!("--browser-executable-path={chrome}")) .arg("--browser-headless") .arg("--browser-wait-until=networkidle2") + // Preserve all CSS: single-file's defaults strip rules it considers + // "unused" (breaking CSS nesting) and remove @media blocks that don't + // match the capture viewport (breaking responsive layout). Allow scripts + // to run so JS-applied classes are present when CSS is evaluated. + .arg("--remove-unused-styles=false") + .arg("--remove-alternative-medias=false") + .arg("--block-scripts=false") .output() .with_context(|| format!("failed to spawn {single_file} process"))?;