github gildas-lormeau/single-file-cli v2.15.5

4 hours ago

SingleFile CLI 2.15.5

Changes

  • single-file-core is updated to 1.6.10, see https://github.com/gildas-lormeau/single-file-core/releases/tag/v1.6.10. It carries 28 commits, most of them in the cascade calculation behind --remove-unused-styles, and for the CLI it means the following
  • Archives written with --compress-content are smaller. A stylesheet is stored once per content, so several <link> elements resolving to the same CSS share one file whatever URL each came from, and an @import chain is merged from the leaves up; over 24 real pages that is 736 stylesheet files down to 263, and 3.2 MB less CSS for the browser to parse when the archive is opened. The images SingleFile generates itself are stored as files instead of being inlined as data URIs: the snapshot it takes of a video frame for a poster, the icon beside a blocked video, and the bitmap of a <canvas>
  • An archive unzipped and opened from disk no longer loses stylesheets whose <link> carries crossorigin, which a browser refuses to fetch as a sibling file:// resource. On a capture of a GitHub page that was all 29 of its 29 links
  • Rules that used to disappear from the saved page are kept: a nested selector such as & + & written under a selector list, a vendor-prefixed value like -webkit-linear-gradient(red, blue), a selector escaped or capitalised in a way the comparison did not recognise, and a rule whose protection was miscalculated inside :not(), :has() or :nth-child(... of ...)
  • Rules that used to win when they should not no longer do: a standalone @starting-style block left elements in their before-transition state, a sublayer outranked its parent layer's own declarations, two anonymous @layer {} blocks were treated as one, several shapes of revert-layer rolled back to the wrong declaration, and @scope roots were resolved from the wrong element
  • An @import inlined into the page keeps the cascade layer and the supports() condition it was written under, instead of applying unconditionally and ahead of the layers it was meant to sit inside
  • An iframe saved as srcdoc keeps an empty src, so a page styling iframe:not([src]) { display: none } no longer hides a frame the live page showed
  • Re-capturing a page SingleFile had already saved no longer changes which elements the structural pseudo-classes match
  • --remove-unused-styles is faster, which is most visible on the pages where it was slowest

Co-authored by Claude (Claude Code)

Don't miss a new single-file-cli release

NewReleases is sending notifications on new releases.