1
Fork 0
mirror of https://github.com/thegeneralist01/archivr synced 2026-07-21 18:55:36 +02:00

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.
This commit is contained in:
TheGeneralist 2026-06-24 21:15:36 +02:00
parent fbb96fbd05
commit 852cc45956
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4

View file

@ -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"))?;