SingleFile CLI 2.27.0
New features
-
New option
--load-deferred-content-expand-viewport: expand the browser viewport to the height of the document while loading deferred content, and restore it before the page is read. By default, the page is only made to believe it is that tall. This option loads the content of pages that measure the viewport in a way the emulation does not reach (e.g. an element sized with thevhunit). No zoom-out is applied unless--load-deferred-content-min-zoom-factoris set. A page that does not react to the restored size is saved with the elements it sized from the tall viewport.single-file https://www.example.com/gallery page.html --load-deferred-content-expand-viewport -
The unused CSS rules of the stylesheets found in shadow roots are now removed, they were always saved whole. On a Reddit thread with 240 comments, the saved page goes from 394 MB to 21 MB (gildas-lormeau/SingleFile#1514).
-
The deferred content is now also loaded on a page that keeps the document at the size of the window and scrolls an inner element. Such a page was saved with its first rows only.
-
An SVG file referenced by a
useelement is inlined in the page, the image was lost before.
CLI fixes and improvements
- Updated single-file-core to 1.14.1:
- a stylesheet containing
:is()or:where()with an empty argument list no longer makes the save fail with "Cannot read properties of null (reading 'data')" (gildas-lormeau/SingleFile#2058 by @alekssmitt) - with
--selected-elements-selector, the selected content is no longer saved as a blank page when it is displayed through the slots of web components (gildas-lormeau/SingleFile#2060 by @FvH01)
- a stylesheet containing
Co-authored by Claude (Claude Code)