Commit Graph

351 Commits

Author SHA1 Message Date
Yanzhen Yu
e9a5aeed06 expose blockSelector as a public option 2026-04-01 12:00:00 +08:00
Yanzhen Yu
528b8373a0 upgrade to rrweb-snapshot v1.0 2026-04-01 12:00:00 +08:00
Lucky Feng
10f79eeba4 style: delete a useless constant 2026-04-01 12:00:00 +08:00
Lucky Feng
5ad550c0db fix: elements would lose some states like scroll position because of "virtual parent" optimization (#427)
* fix: elements would lose some state like scroll position because of "virtual parent" optimization

* refactor: the bugfix code

bug: elements would lose some state like scroll position because of "virtual parent" optimization

* fix: an error occured at applyMutation(remove nodes part)

error message:
Uncaught (in promise) DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node
2026-04-01 12:00:00 +08:00
Lucky Feng
d7da4c289c feat: add an option to determine whether to pause CSS animation when playback is paused (#428)
set pauseAnimation to true by default
2026-04-01 12:00:00 +08:00
Lucky Feng
14ed8ad1e6 fix: applyScroll function doesn't work in sync mode(play at a specific time) (#426)
applyScroll function should be called after all of new nodes mounted on dom
2026-04-01 12:00:00 +08:00
Eoghan Murray
8833d3c7ce Ensure animations don't continue playing when we've paused playback (#417) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
0efc644a29 update link style 2026-04-01 12:00:00 +08:00
Yanzhen Yu
aeeafddb46 update docs 2026-04-01 12:00:00 +08:00
Yaozu Lv
4c9fc8ce70 Add record option maskInputFn for custom mask input function (#409) 2026-04-01 12:00:00 +08:00
Eoghan Murray
4726500979 Allow .on to be chained directly after the constructor so that event handling for the first full snapshot can be added straight after constructor. See #216 (#416) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9ef95fe06e add link to rrvideo 2026-04-01 12:00:00 +08:00
踩坑小王子
13b8a69213 feat: enable to change the config of mouse tail while playing (#410)
fix a potential bug: handleResize function might change the display style of mouseTail
2026-04-01 12:00:00 +08:00
Yanzhen Yu
8607cb6071 Release 0.9.9 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f8c0643eb8 fix serializeNodeWithId args 2026-04-01 12:00:00 +08:00
yz-yu
4118f12582 Fix CI (#405)
* add yarn.lock to CI

* update travis config

* replace data url by placeholder in CI
2026-04-01 12:00:00 +08:00
Jonithan
d21f86cacd docs: add “重新制作快照” anchor link and "隐私" anchor link (#399) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e797ecf820 upgrade rrweb-snapshot 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
Yanzhen Yu
b1291cf48e Release 0.9.8 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f511425d7e ignore removed move set 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
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
yz-yu
0d988c68ff fix docs link (#386) 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
5678e3a062 Release 0.9.7 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
80172126cf Release 0.9.6 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
jackycoder
28d599f91b fix polyfill NodeList forEach (#357) 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
87e467af79 Release 0.9.5 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
Justin Halsall
95dd144227 child nodes without __sn now remove without error (#307) 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
8649ae2752 fix last played timestamp when it is a mousemove event 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
6c6f9c14da Release 0.9.4 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
6651877af9 Release 0.9.3 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
2501993f07 close #336 add pointer-events: null to mouse tail wrapper 2026-04-01 12:00:00 +08:00
Yanzhen Yu
3c7e28b951 update #324, fix typo 2026-04-01 12:00:00 +08:00
Yanzhen Yu
11af001514 close #342 send SET_SPEED event when setConfig 2026-04-01 12:00:00 +08:00
Yanzhen Yu
07d661f3a2 Release 0.9.2 2026-04-01 12:00:00 +08:00
Yanzhen Yu
8f3ea2b76a close #330 implement more accurate finish event 2026-04-01 12:00:00 +08:00
Yanzhen Yu
048aadaec5 close #51 add mouse tail feature 2026-04-01 12:00:00 +08:00
Yanzhen Yu
867ba85049 hide iframe before first meta event 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6ba84ee5d0 Release 0.9.1 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f83f4e7b13 close #161 support "addEvent" in any state 2026-04-01 12:00:00 +08:00