🚀 Three new “super power” export plugins — toHtml / toGif / toMp4 (+ snapdom 2.12.2) #424
Closed
tinchox5
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This release expands the official plugins package with three new client-side exporters: HTML, GIF, and video.
Showcase: https://snapdom.dev
Current version:
@zumer/snapdom-plugins@2.2.0New Plugins
html-export:
result.toHtml()Export a capture as a self-contained, re-renderable HTML document instead of a raster image.
The plugin unwraps the SVG
<foreignObject>generated by SnapDOM, preserving the captured markup and inlined CSS. This makes it useful for snapshot diffing, archiving, or restoring a capture as real DOM.gif-export:
result.toGif()Record an animated GIF by repeatedly capturing the live element over time.
The plugin includes a built-in GIF89a encoder with median-cut quantization and LZW compression, with no external dependencies. CSS animations and dynamic content are captured as they run.
Options include
fps,duration,frames,maxColors,background,scale, andrepeat.video-export:
result.toMp4()Record video using the native
MediaRecorderAPI.Safari typically exports MP4/H.264, while Chromium-based browsers usually exports WebM/VP8 or WebM/VP9. The plugin selects the best supported codec and adjusts the downloaded filename accordingly.
Options include
fps,duration,frames,background,scale, andbitrate.All three plugins follow the same exporter plugin contract as the core SnapDOM exporters. They support the existing
beforeExportandafterExportpipeline and can be composed with other official plugins such as filters, timestamp overlays, and color tinting.Core Update: snapdom 2.12.2
This release also includes a fix for scrolled elements, such as
<pre>blocks withoverflow: auto.Previously, inherited text formatting could be lost during capture. In some cases, properties like
white-space: pre-wrapand monospace fonts were overridden, causing code blocks to render incorrectly.The issue was caused by the scroll wrapper injected by SnapDOM to offset scrolled content. Since the wrapper was a
<div>, default per-tag CSS could override inherited formatting. The wrapper now usesall: unset, allowing inherited text properties to pass through while keeping non-inherited properties neutral.Scrolled code blocks should now match the live DOM more accurately.
Links
@zumer/snapdom-plugins@zumer/snapdom@2.12.2community-plugins.mdAll reactions