SingleFile CLI 2.16.0
New features
--image-qualitysets the quality used to re-encode the JPEG and WebP images resized with--image-reduction-factor, from 0 to 1 (default 0.8). With 1, WebP images are saved without loss. It has no effect on PNG images (SingleFile#2001)
CLI fixes and improvements
- The
Referersent for a resource now follows the same rules as the browser:- The
referrerpolicyattribute of an<img>,<link>or<script>is applied to its own request. - An image, a font or an
@importreferenced from an external stylesheet gets a referrer computed from that stylesheet and itsReferrer-Policyheader, not from the page, when the page cannot fetch it itself (e.g. a file on another site without CORS). When the stylesheet gives no referrer, none is sent in all cases. - With
--browser-engine firefox, a referrer policy that relaxes the default is ignored for a cross-site request, as Firefox does.
- The
--compress-csshas no effect anymore. It saved almost nothing and could move background images. The option is still accepted, so existing commands keep working--image-reduction-factorhelp now says that images whose size is not set by the page (e.g. icons, logos) are displayed smaller- single-file-core is updated to 1.6.18, see https://github.com/gildas-lormeau/single-file-core/releases/tag/v1.6.14 to https://github.com/gildas-lormeau/single-file-core/releases/tag/v1.6.18. For the CLI it means the following
- With
--image-reduction-factor, resized WebP images were re-encoded losslessly with Chromium, so the option only saved the pixels it removed. They are now lossy (quality 0.8), like with Firefox. On the page of SingleFile#2001, the archive went from 73.1MB to 9.6MB --image-reduction-factornow also resizes the snapshots of<canvas>elements, and no longer resizes the images ofbackgroundattributes, which the browser repeats at their natural size- A resized SVG
<image>withoutwidthandheightkeeps its displayed size - A save could wait forever when an image failed to be re-encoded. The original image is kept instead
- A
<link>stylesheet was dropped when its fetch failed, although the page had loaded it. Its rules are now read from the page when the browser allows it, which is the case with--browser-engine firefox - Shadow roots keep their
delegatesFocusflag and their manual slot assignments - The
<source>children and theenvironmentmapattribute of<model>elements are embedded, and model files are saved with their real type - A resource fetched with no expected type (e.g. a PDF in an
<object>) was requested with the headerAccept: undefined. It is nowAccept: */* --remove-unused-stylesno longer removes:- vendor-prefixed values the saving browser does not support, e.g.
-moz-values in a save made with Chromium; - fallbacks written before a newer value;
- the declaration a
revert-rulerolls back to; - rules inside
@when/@else; - an unmatched selector needed to keep the specificity of a nested rule.
- vendor-prefixed values the saving browser does not support, e.g.
- The infobar no longer flashes orange when it is expanded right after the saved page is opened
Co-authored by Claude (Claude Code)