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:
parent
fbb96fbd05
commit
852cc45956
1 changed files with 7 additions and 0 deletions
|
|
@ -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"))?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue