v1.3.0
@harperfast/prerender-browser v1.3.0
Configurable hydration capture for JS-heavy sites (Bazaarvoice reviews, Curalate UGC,
Slick carousels). All new options are opt-in — defaults reproduce prior behavior, so
existing deployments render exactly as before.
New config options
Navigation / wait
navigation.domStableMs/domStableTimeoutMs/domStablePollMs/domStableTolerance—
wait until the (shadow-aware) DOM element count holds steady instead of relying solely on
network-idle. Reliable "content is done" signal for widgets that begin loading after a
network lull.domStableMs: 0(default) disables it.
Scroll
scroll.settleUntilStable+scroll.settleStablePasses— loop full scroll-passes (with a
network-idle wait between each) until the DOM stops changing, instead of a single
scroll-to-bottom. Keeps IntersectionObserver-lazy widgets in view long enough to finish
loading (review lists, UGC carousels) before the snapshot. Bounded bydomStableTimeoutMs.
Resource blocking
block.stubImages— answer blockedimagerequests with a 1×1 transparent GIF (HTTP 200)
instead of aborting. Lazy-loaders that fall back to a placeholder on load error (e.g.
Slick) keep their realsrcURLs, so the serialized HTML retains real image URLs and shows
no broken-image placeholders — at ~43 bytes per image.
Post-processing
postProcess.resolveLazyImages— copy a real URL fromdata-lazy/data-src/
data-original/srcsetintosrcfor images that never received one (off-screen
carousel/grid slides), so they load when the page is served.postProcess.flattenShadowDom— inline open shadow roots into the light DOM (with
host-scoped CSSOM/:hostrule rewriting) so content rendered in shadow DOM — which
outerHTMLomits — is serialized, without the shadow's CSS leaking onto the rest of the page.postProcess.stripBlockedResources— remove resource elements (img/iframe/script/…) whose
URL matches ablock.urlPatternsentry from the serialized output, so ad/RUM/analytics
pixels don't fire (or error) when the cached page is loaded.
Notes
- No breaking changes. 15/15 existing tests pass.
dist/is built at release time (gitignored); the tarball workflow runsnpm run build.