Commit Graph

954 Commits

Author SHA1 Message Date
Yanzhen Yu
e797ecf820 upgrade rrweb-snapshot 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c6552fbcca Release 0.7.1 2026-04-01 12:00:00 +08:00
Yanzhen Yu
4137985b01 optimize the append queue algorithm
Loop the append queue has been proved to be very inefficient, and
some times lead to N^2 time complexity.

Especially when some abnormal data could not be appended into the
real DOM, will make a dead loop.

Previously we use a 5000ms time out to handle this, which is not
user-friendly and not explicitly.

In this patch, we transform the queue into a tree data structure,
which reflects the layout of real DOM. With the tree data structure,
we can find whether there are dangling nodes that need to be dropped.
Also, the iteration will be much more efficient.

There is still a 500ms time out to avoid a dead loop, but should not
be called in expected scenarios.
2026-04-01 12:00:00 +08:00
Daniël van de Giessen
53a0887e9e Cross-platform npm scripts using cross-env (#2) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
b1291cf48e Release 0.9.8 2026-04-01 12:00:00 +08:00
Yanzhen Yu
15c66d1fe7 Release 0.7.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f511425d7e ignore removed move set 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6259ae631d add camel case svg element tag names to tag map 2026-04-01 12:00:00 +08:00
Justin Halsall
455c4d76f4 Add support for StylesheetRule in document fragment (#293)
* add failing test

* add stylesheet to dom to manipulate the rules

* cleanup
2026-04-01 12:00:00 +08:00
Yanzhen Yu
ca8288802f do not add origin before data uri image 2026-04-01 12:00:00 +08:00
Eoghan Murray
70fe32b5d2 Suspend mutations during snapshot (#385)
* The `processMutations` function needed to be bound to the `mutationBuffer` object, as otherwise `this` referred to the `MutationObserver` object itself

* Enable external pausing of mutation buffer emissions

 - no automatic pausing based on e.g. pageVisibility yet, assuming such a thing is desirable
   https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
 - user code has to call new API method `freezePage` e.g. when page is hidden or after a timeout
 - automatically unpauses when the next user initiated event occurs
   (am assuming everything that isn't a mutation event counts as 'user initiated'
   either way think this is the correct thing to do until I see a counterexample
   of an event that shouldn't cause the mutations to be unbufferred)

* Avoid a build up of duplicate `adds` by delaying pushing to adds until emission time

* Need to export freezePage in order to use it from rrweb.min.js

* Add a test to check if mutations can be turned off with the `freezePage` method

* I noticed out of order ids (in terms of a DOM walk) in a FullSnapshot.  A DOM mutation was executed against the mirror asynchronously before it could be fully processed. This would lead to a situation in replay where a mutation is executed against a DOM tree that already has the mutation applied. This changeset fixes that by freezing any mutations until the snapshot is completed.

* Remove attribute modifications from a mutation event that were incorrect in that they were repeating the attributes of those nodes present in the 'adds' array of the same mutation

* I've manually verified that this empty text node is actually removed when the dropdown is opened:

document.getElementById('select2-results-1').childNodes
NodeList(2) [li.select2-results-dept-0.select2-result.select2-result-selectable.select2-highlighted, li.select2-results-dept-0.select2-result.select2-result-selectable]

and also that it is not reinstated after the second `await page.click('.select2-container');`

* Rearrange when removal happens in order to satisfy tests. I'm also reverting a recent test change (2600fe7) so that tests pass after this rearrangement; I believe that test change to still be the correct way of doing it, but maybe it is not strictly important that there are extra mutations on attributes of just added nodes

* As mutations are now paused during FullSnapshots, we shouldn't be counting this as a 'user emission'. We automatically emit mutations after unpause anyway ('emit anything queued up now')

* Ensure that we clear arrays before emitting, as the mutation could have the side effect of triggering a FullSnapshot (checkoutEveryNth), which would otherwise re-trigger emission of same mutation (through the new pause/fullsnapshot/mutationemit/unpause process)

* Don't let the programattic pausing during TakeFullSnapshot accidentally unpause a manual call to the API method `freezePage`

* Rename paused -> frozen for consistency and change to use getter/setter access methods
2026-04-01 12:00:00 +08:00
Yanzhen Yu
a75a35b832 Release 0.6.11 2026-04-01 12:00:00 +08:00
yz-yu
0d988c68ff fix docs link (#386) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
55ce53ffa0 close before open to make sure document was closed 2026-04-01 12:00:00 +08:00
yz-yu
655f96da61 Update zh_CN Docs (#384)
* update zh_CN guide, with latest API and options

* add receipes

* update receipes and guide

* update #329 add links to README
2026-04-01 12:00:00 +08:00
Yanzhen Yu
7f03296b5f Release 0.6.10 2026-04-01 12:00:00 +08:00
Yanzhen Yu
5678e3a062 Release 0.9.7 2026-04-01 12:00:00 +08:00
Yanzhen Yu
259a929a76 delete not needed props 2026-04-01 12:00:00 +08:00
Yanzhen Yu
4fc632b40e fix queue and use a unsafe but performant checker 2026-04-01 12:00:00 +08:00
Yanzhen Yu
66d71a3d2e Release 0.6.9 2026-04-01 12:00:00 +08:00
Yanzhen Yu
80172126cf Release 0.9.6 2026-04-01 12:00:00 +08:00
Yanzhen Yu
2d1d3596b8 handle block element 2026-04-01 12:00:00 +08:00
jackycoder
9af39386d4 compatibility fixes (#358)
* fix polyfill NodeList forEach

* contentDocument.contains for IE

* polyfill DOMTokenList forEach
2026-04-01 12:00:00 +08:00
Yanzhen Yu
9667a9ae46 update README 2026-04-01 12:00:00 +08:00
jackycoder
28d599f91b fix polyfill NodeList forEach (#357) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7aa3410aea update the test snapshot 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e6c0f787af close #356 improve loop checker 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c73368a996 Release 0.6.8 2026-04-01 12:00:00 +08:00
Yanzhen Yu
87e467af79 Release 0.9.5 2026-04-01 12:00:00 +08:00
Yanzhen Yu
8b470ab6c8 remove _cssText attribute from style element 2026-04-01 12:00:00 +08:00
Yanzhen Yu
0ca0554613 make sure rrweb do not use browser API in static stage 2026-04-01 12:00:00 +08:00
Yanzhen Yu
a36fae560f Release 0.6.7 2026-04-01 12:00:00 +08:00
Justin Halsall
95dd144227 child nodes without __sn now remove without error (#307) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c458db3d8e ignore iframe src attribute 2026-04-01 12:00:00 +08:00
Yanzhen Yu
58504e7d77 close #350 catch error may caused by checkout feature 2026-04-01 12:00:00 +08:00
Yanzhen Yu
791b553b11 add release-it cli config 2026-04-01 12:00:00 +08:00
Yanzhen Yu
8649ae2752 fix last played timestamp when it is a mousemove event 2026-04-01 12:00:00 +08:00
Yanzhen Yu
573a703dd4 add release-it config 2026-04-01 12:00:00 +08:00
Yanzhen Yu
8b198b338e impl #309 observe font face set changes 2026-04-01 12:00:00 +08:00
Yanzhen Yu
fe8a9ea6ca Release 0.6.6 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6c6f9c14da Release 0.9.4 2026-04-01 12:00:00 +08:00
Yanzhen Yu
cdedca1716 complately update relative path regexp 2026-04-01 12:00:00 +08:00
Yanzhen Yu
0e30a819ce clean up __ln property when remove node 2026-04-01 12:00:00 +08:00
Yanzhen Yu
cf54d7dab5 Release 0.6.5 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6651877af9 Release 0.9.3 2026-04-01 12:00:00 +08:00
Yanzhen Yu
08bee23494 fix absolute to doc 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9b097ad030 close #322 hook select element selectedIndex property 2026-04-01 12:00:00 +08:00
Yanzhen Yu
2ced819b40 Release 0.6.4 2026-04-01 12:00:00 +08:00
Yanzhen Yu
2501993f07 close #336 add pointer-events: null to mouse tail wrapper 2026-04-01 12:00:00 +08:00
Yanzhen Yu
286475f1c3 Release 0.6.3 2026-04-01 12:00:00 +08:00