Commit Graph

70 Commits

Author SHA1 Message Date
Justin Halsall
599e07d9a3 yarn typings (#635) 2026-04-01 12:00:00 +08:00
Justin Halsall
fd76a7bcd8 Fixes to #628 to help it pass typescript's type checking (#634)
* My best interpretation of what the typings should look like after merge of #464

* Apply variable name changes as per Juice10 review

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>

* fix types

Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
Eoghan Murray
fb381a1254 Ignore firstFullSnapshot once only after initial 'poster' build (#608)
* Encountered a bug where firstFullSnapshot was played twice because timer was immediately started and reached the snapshot before the setTimeout returned

* Ignoring a FullSnapshot needs to be a one-time only thing, as otherwise we'll ignore it after scrubbing (restarting play head at a particular time). This is a problem if mutations have altered the player state, and we try to replay those mutations, so we e.g. try to remove an element that has already been removed because we haven't reset the FullSnapshot state

* Some `npm run typings` related fixups
2026-04-01 12:00:00 +08:00
Yanzhen Yu
ed46394562 rename console replay plugin 2026-04-01 12:00:00 +08:00
Justin Halsall
4dcd674e34 Mask value attribute changes for elements in maskInputOptions (#602)
* mask value attribute changes for elements in maskInputOptions

* refactor initInputObserver to use maskInputValue

* add todo

* Fix typo

* upgrade rrweb-snapshot to 1.1.6

* move maskInputValue to rrweb-snapshot
2026-04-01 12:00:00 +08:00
bachmanity1
059d492bea add keepIframeSrcFn option (#592)
* rename allowIframe to keepIframeSrcFn

* update rrweb-snapshot to 1.1.5
2026-04-01 12:00:00 +08:00
yz-yu
c550a4b088 plugin API (#598)
* temp: plugin API

* fix a bug in the replay handler and rename some type names.

* update integration test

* improve plugin types and handle legacy log data

* use different naming in record and replay bundles

* delete unreferenced types

Co-authored-by: Lucky Feng <294889365@qq.com>
2026-04-01 12:00:00 +08:00
bachmanity1
6de0efa01f implement video seek feature (#593)
* implement video seek feature

* rm attribute from MediaInteractions

* resolve ts warning

* use getEventTarget
2026-04-01 12:00:00 +08:00
Yun Feng
0235cd4d0a update typings and fix lint errors 2026-04-01 12:00:00 +08:00
Yanzhen Yu
b693d667b5 create mirror during record 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e9784a20cb fix #565 add departed warning 2026-04-01 12:00:00 +08:00
Lucky Feng
b30b37c889 fix: #542 wrong results of splitting log stacks (#547)
fix bug of stack parcer and increase compatibility for different browser vendors
2026-04-01 12:00:00 +08:00
Lucky Feng
424044ede3 fix: issue #548 (#550)
1. Do not use virtual parent optimization if the mutation targets have iframe elements as children. This will cause some performance regression but will be easy to add and ship.
2. If an iframe element has already been a child of a virtual parent, add the virtual parent back to the dom.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
e339ebb90b update typings file 2026-04-01 12:00:00 +08:00
re-fort
b1b25447ff Add options to mask texts (#540)
* feat: add options to mask texts

* feat: add the default mask function

* refactor: rename options to identify the difference between  mask text and mask input

* test: add tests about masking

* doc: add options about masking

* chore: bump up rrweb-snapshot version
2026-04-01 12:00:00 +08:00
Lucky Feng
66c7c8f028 fix: inaccurate mouse position (#522)
1. Position of mouse was inaccurate when replaying and this PR will fix it.
2. Fix the bug that if one nested iframe has a scale transform and the position of mouse was inaccurate as well.
2026-04-01 12:00:00 +08:00
Province Innovation
eeac998959 Added mousemoveCallback threshold option to sampling config. (#492)
* Added mousemoveCallback threshold option to sampling config.

* Added mousemoveCallback to definitions file.
2026-04-01 12:00:00 +08:00
yz-yu
33f0ac5cfe Impl record iframe (#481)
* Impl record iframe

* iframe observe

* temp: add bundle file to git

* update bundle

* update with pick

* update bundle

* fix fragment map remove

* feat: add an option to determine whether to pause CSS animation when playback is paused (#428)

set pauseAnimation to true by default

* 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

* pick fixes

* revert ignore file

* re-impl iframe record

* re-impl iframe replay

* code housekeeping

* move multi layer dimension calculation to replay side

* update test cases

* teardown test server

* upgrade rrweb-snapshot with iframe load timeout

Co-authored-by: Lucky Feng <yun.feng@smartx.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
9f3f4d15f2 Discovered that the common case of mouse movement or scrolling happening during takeFullSnapshot was causing mutations to be immediately emitted, contrary to the goal of https://github.com/rrweb-io/rrweb/pull/385 (#470) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
fbe75532f4 Release 0.9.12 2026-04-01 12:00:00 +08:00
Lucky Feng
9d2db86d5a feat: enable rrweb to record and replay log messages in console (#424)
* wip: working on rrweb logger

* wip: can record and replay some simple log

* wip: can record and replay log's stack

* wip: try to serialize object

* wip: record and replay console logger

hijack all of the console functions.
add listener to thrown errors

* wip: record and replay console logger
add limit to the max number of log records

* feat: enable rrweb to record and replay log messages in console

this is the implementation of new feature request(issue #234)

here are a few points of description.
1. users need to set recordLog option in rrweb.record's parameter to record log messages.  The log recorder is off by default.
2. support recording and replaying all kinds of console functions. But the reliability of them should be tested more
3. the stringify function in  stringify.ts needs improvement. e.g. robustness, handler for cyclical structures and better support for more kinds of object
4. we can replay the log messages in a simulated html console like LogRocket by implementing the interface "ReplayLogger" in the future

* improve: the stringify function

1. handle cyclical structures
2. add stringify option to limit the length of result
3. handle function type

* refactor: simplify the type definition of ReplayLogger
2026-04-01 12:00:00 +08:00
Yanzhen Yu
519aa8d424 pick #286 allow short cut for slim DOM options 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f7260da556 Release 0.9.10 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
Yanzhen Yu
f8c0643eb8 fix serializeNodeWithId args 2026-04-01 12:00:00 +08:00
Yanzhen Yu
b1291cf48e Release 0.9.8 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
80172126cf Release 0.9.6 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
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
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
e1c0631eeb Release 0.9.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
a31efdc169 close #274 implement the new state management proposal 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e056f1ae88 add the patch function to utils 2026-04-01 12:00:00 +08:00
Eoghan Murray
5b0539419c Restore functioning of #200 - this got broken after #242 (#246)
- What was broken was that it would just play activity from the first page view, but then would stop at the second page view (meta) as actions after that had been discarded
 - This restores the functionality given by the comment 'return the events from last meta to the end.' - we never want to discard events that are after the baseline time
 - I believe 'session' is the incorrect terminology for this function name, as a session in web analytics usually means a series of page views
2026-04-01 12:00:00 +08:00
Yanzhen Yu
42a205e4c5 update typings entry 2026-04-01 12:00:00 +08:00
Yanzhen Yu
81b3407dd7 export utils as public API 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6b10e1c4ee update typescript to 3.9.5 2026-04-01 12:00:00 +08:00
Eoghan Murray
d57cae3d51 Move mutation processing into it's own class (#223)
* Move mutation processing into it's own object.

This should stand on it's own as a refactor, but is intended as a basis
for exposing the new MutationBuffer object to further outside control e.g.
to 'mute' or batch up mutation emission when the page becomes inactive
from a https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
point of view

* The `processMutations` function needed to be bound to the `mutationBuffer` object, as otherwise `this` referred to the `MutationObserver` object itself

* Neglected to add this output of `npm run typings`

* Get around the binding problem by using Arrow function expressions

* Prettier formatting
2026-04-01 12:00:00 +08:00
Yanzhen Yu
bc78468ef4 Release 0.7.32 2026-04-01 12:00:00 +08:00
yz-yu
dcad6ff922 Packer (#172)
* introduce pako and add general packer interface

* add tests for packer

* use function API instead of class API for better tree shaking support

* refcatoring the rollup bundle config
2026-04-01 12:00:00 +08:00
Yanzhen Yu
f1adef4693 Release 0.7.31 2026-04-01 12:00:00 +08:00
Yanzhen Yu
91064d48cb Release 0.7.29 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9035a8f814 Release 0.7.28 2026-04-01 12:00:00 +08:00
Yanzhen Yu
fb13d24a86 Release 0.7.27 2026-04-01 12:00:00 +08:00
yz-yu
1afc0b7527 add hooks API (#132) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
2ac8634607 re-add addCustomEvent function via function property 2026-04-01 12:00:00 +08:00