rrweb-snapshot
0.0.68
Patch Changes
-
#4320
837363eThanks @posthog! - Bound the main-thread cost of the recorder's initial full snapshot, and start measuring it.stringifyStylesheetreadscssTextfor every CSSRule of every stylesheet, all inside the one uninterruptible task that takes the full snapshot. On CSS-heavy pages that is the dominant cost, and it has been observed freezing the UI (no rendering, scrolling, or cursor movement) for seconds. The existingmaxDepthguard doesn't help, since it only bounds deep DOMs, not wide ones or heavy CSS.Stylesheet inlining now stops after a budget of CSSRules per snapshot (
session_recording.inlineStylesheetBudgetRules, default 10,000; set0for the previous unbounded behaviour). Sheets past the budget are serialized without_cssText, keepingrel/hrefso replay can load them remotely, and are then inlined one per idle callback and delivered as attribute mutations. Replay fidelity is preserved; the work is just no longer one long blocking task.The snapshot's cost is also now measured and reported on captured events, so slow snapshots are visible without a browser profile:
$sdk_debug_replay_slowest_full_snapshot_ms,$sdk_debug_replay_slowest_full_snapshot_stylesheet_ms,$sdk_debug_replay_slowest_full_snapshot_nodes,$sdk_debug_replay_slowest_full_snapshot_css_rules,$sdk_debug_replay_deferred_stylesheets, and, for the incremental path,$sdk_debug_replay_slowest_mutation_batch_ms. (2026-08-05)
0.0.67
Patch Changes
- #4209
569fc62Thanks @posthog! - Session recording no longer emits an uncaughtTypeError: Illegal invocationfrom the input observer's synchronous native-setter call. The previous fix only guarded the deferred hooked setter; the synchronousoriginal.set.call(this, value)still ran with a non-nativethis(a proxy, custom element, or cross-realm object) and threw inside the host page's own assignment. The recorder now probes the native getter — which fails the same internal-slot brand check as the setter — before forwarding: a non-nativethisis skipped, so the recorder no longer re-throws from its own frame, while genuine elements (including file inputs that legitimately throw on a programmatic value) keep their native behavior. The input event handler andgetInputTypeare similarly guarded against reading native accessors on a non-nativethis. (2026-07-22)
0.0.66
Patch Changes
- #4114
c75c0baThanks @hpouillot! - fix: avoid throwing when rrweb recorder cleanup cannot remove a listener (2026-07-08)
0.0.65
Patch Changes
- #3678
add2faeThanks @ksvat! - fix(replay): keepph-no-captureplaceholders in normal flow during replay. Blocked elements were rebuilt withposition: absolute+ recordedleft/topregardless of how they were originally positioned, pulling in-flow elements (flex/grid children, inline spans) out of flow and collapsing sibling layout. Snapshot now captures the element's computedposition,transform, anddisplay; rebuild only forces absolute positioning when the original was non-static or contributed a transform, and promotes inline placeholders toinline-blockso the redacted slot is preserved. Old recordings without the new attributes keep the legacy absolute behavior. (2026-05-27)
0.0.64
Patch Changes
- #3667
cafa9ccThanks @pauldambra! - fix(replay): stop polling preload-as-style<link>elements forever. Session recorder treated<link rel="preload" as="style" href="*.css">as if it were a stylesheet and waited forlink.sheetto populate. Per spec preload links never instantiate aCSSStyleSheet, so the wait timed out, re-serialized the link, scheduled another wait, and leaked aloadlistener on every cycle — multiplying further on every realloadevent. Pages with Next.js-style CSS preloads accumulated thousands of active polling chains, saturating the main thread and freezing the tab on refocus (2026-05-26)
0.0.63
Patch Changes
- #3635
5fb74b6Thanks @TueHaulund! - Capture<link rel="stylesheet">URLs fromlink.sheet.hrefand trylink.sheetdirectly for inlining, so recordings survive SPAhistory.pushStatenavigations between routes of different path depths (wherelink.hrefre-resolves against a new baseURI butlink.sheet.hrefpreserves the URL the browser actually fetched). (2026-05-21)
0.0.62
Patch Changes
- #3542
94a5ba0Thanks @TueHaulund! - Preserve<style>textContent when the browser's CSSOM serialization would emit empty longhands fromvar()inside a shorthand. When a stylesheet has e.g.padding: var(--p); padding-bottom: var(--pb);, browsers store the shorthand's longhands with empty token lists per the CSS Custom Properties spec, andCSSStyleRule.cssTextre-emits them aspadding-top: ; padding-right: ; padding-left: ;. The previous behavior replaced the<style>text with that corrupted output, silently dropping layout rules on replay. We now detect the empty-longhand pattern and keep the original textContent in that case. Affects users of any CSS-in-JS framework that combinesvar()with shorthands (Chakra UI v3, Panda CSS, Emotion, etc.). Same class of bug as rrweb-io/rrweb#1667. (2026-05-07)
0.0.61
Patch Changes
- #3510
a5d86c9Thanks @arnaudhillen! - Move posthog-rrweb sources into the posthog-js monorepo underpackages/rrweb/. The seven packages we publish (@posthog/rrweb,@posthog/rrweb-types,@posthog/rrweb-utils,@posthog/rrdom,@posthog/rrweb-snapshot,@posthog/rrweb-record,@posthog/rrweb-plugin-console-record) now release from this repo via the existing changesets pipeline. No runtime behavior changes. (2026-05-05)
2.0.0-alpha.18
Major Changes
- #1593
5a78938Thanks @daibhin! -NodeTypeenum was moved from rrweb-snapshot to @rrweb/types The following types where moved from rrweb-snapshot to @rrweb/types:documentNode,documentTypeNode,legacyAttributes,textNode,cdataNode,commentNode,elementNode,serializedNode,serializedNodeWithId,serializedElementNodeWithId,serializedTextNodeWithId,IMirror,INode,mediaAttributes,attributesandDataURLOptions
Patch Changes
-
#1331
02cc62dThanks @billyvg! - fix dimensions for blocked element not being applied -
#1535
04ee6edThanks @eoghanmurray! - Slight simplification to how we replace :hover after #1458 -
#1437
5fbb904Thanks @eoghanmurray! - Edge case: Provide support for mutations on a <style> element which (unusually) has multiple text nodes
2.0.0-alpha.17
Minor Changes
- #1503
335639aThanks @Juice10! - Record dialog's modal status for replay in rrweb. (Currently triggeringdialog.showModal()is not supported in rrweb-snapshot's rebuild)
Patch Changes
-
#1417
40bbc25Thanks @YunFeng0817! - fix: duplicate textContent for style elements cause incremental style mutations to be invalid -
#1533
d350da8Thanks @jeffdnguyen! - Fixurl()rewrite for nested stylesheets by rewriting during stringification instead of after -
#1509
be6bf52Thanks @Juice10! - Reverse monkey patch built in methods to support LWC (and other frameworks like angular which monkey patch built in methods).
2.0.0-alpha.16
Patch Changes
-
#1386
a2c8a1aThanks @ababik! - Fix that the optionalmaskInputFnwas being accidentally ignored during the creation of the full snapshot -
#1512
d08624cThanks @eoghanmurray! - optimisation: skip mask check on leaf elements
2.0.0-alpha.15
Major Changes
- #1497
2606a2aThanks @Juice10! - Distributed files have new filenames, paths and extensions. Important: If you reference distributed files or types directly, you might have to update your paths/filenames. E.g. you import fromrrweb/typings/...orrrdom/es. However you runimport rrweb from '@posthog/rrweb'you won't notice a difference with this change. If you include rrweb files directly in a script tag, you might have to update that path to include a the.umd.cjsfiles instead. All.jsfiles now use ES modules which can be used in modern browsers, node.js and bundlers that support ES modules. All npm packages now also ship.cjsand.umd.cjsfiles. The.umd.cjsfiles are CommonJS modules that bundle all files together to make it easy to ship one file to browser environments (similar to the previous.jsfiles). The.cjsfiles are CommonJS modules that can be used in older Node.js environments. Types should be better defined inpackage.jsonand if you need specific types they might be exported from new packages (for examplePlayerMachineStateandSpeedMachineStateare now exported from@rrweb/replay). Check thepackage.json'smainandexportsfield for the available files.
Patch Changes
-
#1468
4014305Thanks @eoghanmurray! - inlineImages: during snapshot avoid adding an event listener for inlining of same-origin images (async listener mutates the snapshot which can be problematic) -
#1493
82f6fecThanks @eoghanmurray! - Replay: Replace negative lookbehind in regexes from css parser as it causes issues with Safari 16 -
#1482
f3cf092Thanks @AlfieJones! - (whenrecordCanvas: true): ensure we use doc.createElement instead of document.createElement to allow use in non-browser e.g. jsdom environments -
#760
e08706aThanks @eoghanmurray! - Add slimDOM option to block animation on <title> tag; enabled when the 'all' value is used for slimDOM
2.0.0-alpha.14
Patch Changes
-
#1464
03b5216Thanks @colingm! - better support for coexistence with older libraries (e.g. MooTools & Prototype.js) which modify the in-builtArray.fromfunction -
#1481
46f1b25Thanks @eoghanmurray! - Fix and test for bug #1457 which was affecting replay of complex tailwind css -
#1476
cbbd1e5Thanks @eoghanmurray! - Fixup for multiple background-clip replacement -
#1387
5e7943dThanks @H4ad! - Avoid recreating the same element every time, instead, we cache and we just update the element.Before: 779k ops/s After: 860k ops/s
Benchmark: https://jsbench.me/ktlqztuf95/1
-
#1440
c0f83afThanks @daibhin! - better nested css selector splitting when commas or brackets happen to be in quoted text -
#1467
e96f668Thanks @eoghanmurray! - Bugfix after #1434 perf improvements: fix that blob urls persist on the shared anchor element and can't be later modified
2.0.0-alpha.13
Minor Changes
- #1432
123a81eThanks @Juice10! - Video and Audio elements now also captureplaybackRate,muted,loop,volume.
Patch Changes
2.0.0-alpha.12
Minor Changes
- #1310
7c0dc9dThanks @benjackwhite! - Extends maskTextFn to pass the HTMLElement to the deciding function
Patch Changes
-
#1272
58c9104Thanks @eoghanmurray! - Perf: Avoid creation of intermediary array when iterating over style rules -
#1351
a2be77bThanks @eoghanmurray! - Don't double-record the values of <textarea>s when they already have some content prefilled #1301 -
#1431
a7c33f2Thanks @eoghanmurray! - Ensure :hover works on replayer, even if a rule is behind a media query Respect the intent behind max-device-width and min-device-width media queries so that their effects are apparent in the replayer context -
#1155
8aea5b0Thanks @YunFeng0817! - Feat: Add 'isCustom' flag to serialized elements.This flag is used to indicate whether the element is a custom element or not. This is useful for replaying the :defined pseudo-class of custom elements.
-
#1374
314a8ddThanks @andrewpomeroy! - Capture stylesheets designated asrel="preload" -
#1349
07ac5c9Thanks @eoghanmurray! - Snapshot performance when masking text: Avoid the repeated calls toclosestwhen recursing through the DOM
2.0.0-alpha.11
Patch Changes
-
#1279
11f6567Thanks @eoghanmurray! - Extend to run fixBrowserCompatibilityIssuesInCSS over inline stylesheets -
#1287
efdc167Thanks @Juice10! - Upgrade all projects to typescript 4.9.5 -
#1287
efdc167Thanks @Juice10! - Add workaround for Chrome/Edge CSS@importescaping bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1472259
2.0.0-alpha.10
Patch Changes
2.0.0-alpha.9
Patch Changes
2.0.0-alpha.8
Minor Changes
- #1188
bc84246Thanks @benjackwhite! - feat: Extends maskInputFn to pass the HTMLElement to the deciding function
Patch Changes
- #1148
d0fdc0fThanks @YunFeng0817! - Improve: Add try catch to snapshot.ts 's masking text function. Fixes #1118.
2.0.0-alpha.7
Minor Changes
Patch Changes
2.0.0-alpha.6
Minor Changes
Patch Changes
-
#1133
c28ef5fThanks @eoghanmurray! - Fix: CSS transitions are incorrectly being applied upon rebuild in Firefox. Presumably FF doesn't finished parsing the styles in time, and applies e.g. a default margin:0 to elements which have a non-zero margin set in CSS, along with a transition on them.Related bug report to Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1816672
-
#1130
f6f07e9Thanks @Equlnox! - Fix: Make relative path detection in stylesheet URLs to detect more types of URL protocols when inlining stylesheets. -
#1157
8e47ca1Thanks @mydea! - fix: Explicitly handlenullattribute values
2.0.0-alpha.5
Patch Changes
-
#1095
1385f7aThanks @YunFeng0817! - Fix duplicated shadow doms -
#1126
227d43aThanks @YunFeng0817! - Refactor all suffix of bundled scripts with commonjs module from 'js' to cjs #1087.