Commit Graph

940 Commits

Author SHA1 Message Date
Yanzhen Yu
ec5b7a4635 pick #286, export slim DOM options 2026-04-01 12:00:00 +08:00
Yanzhen Yu
11f8a78f71 update typings 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e9a5aeed06 expose blockSelector as a public option 2026-04-01 12:00:00 +08:00
Yanzhen Yu
76ba992d06 Release 0.7.7 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
Yanzhen Yu
b72e01c2fc accept RegExp type block class config 2026-04-01 12:00:00 +08:00
Lucky Feng
10f79eeba4 style: delete a useless constant 2026-04-01 12:00:00 +08:00
Yanzhen Yu
bd42510e23 update typescript and fix test cases 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
Yanzhen Yu
005f7732ad Release 0.7.6 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
Yanzhen Yu
15dd46aadb add typings folder to npm files 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
Yanzhen Yu
21f299a895 Release 0.7.5 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
1534dcf0d8 add typings autogen command 2026-04-01 12:00:00 +08:00
Yanzhen Yu
0efc644a29 update link style 2026-04-01 12:00:00 +08:00
Sam Mason
e21921a2da Make block css class optional & fix test (#6)
* Make block class optional

* Fix test by removing unexpected space space
2026-04-01 12:00:00 +08:00
Yanzhen Yu
aeeafddb46 update docs 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f4ddd261e0 Release 0.7.4 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
Yanzhen Yu
29f2e42978 iterate style element to get css rules string 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
cf210efb56 Release 0.7.3 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9ef95fe06e add link to rrvideo 2026-04-01 12:00:00 +08:00
Yanzhen Yu
67027d8be6 handle empty url path 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
The Gitter Badger
c4b72edcf3 Add Gitter badge (#9) 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
238acc4b06 Release 0.7.2 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f8c0643eb8 fix serializeNodeWithId args 2026-04-01 12:00:00 +08:00
Yanzhen Yu
205d3b4aeb fix the format and use window.location 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
Daniël van de Giessen
4ed15164c9 Fixed detection of multiple consecutive CSS URLs without quotes (#4) 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
Daniël van de Giessen
61c50c2122 Parse style attributes for absolute URL paths (#5) 2026-04-01 12:00:00 +08:00
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