Commit Graph

25 Commits

Author SHA1 Message Date
Yanzhen Yu
32c33f3ce8 move browser related APIs into runtime 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d1b32e6e9d impl #23 add custom privacy selectors 2026-04-01 12:00:00 +08:00
Yanzhen Yu
931f71e738 update mutation observer handler
1. deep delete from adds set when node was dropped
2. remove node from dropped set when node was added again
2026-04-01 12:00:00 +08:00
Yanzhen Yu
12fc5de3a7 check whether the removed node's ancestors has been removed 2026-04-01 12:00:00 +08:00
yz-yu
4a2c733583 improve mouse record and replay (#49)
Increase the throttle value of collecting mouse move and add a
transition time to the replayer's mouse. This may decrease the
size of mouse move data and make the replay movement more smooth.
Another change is to move and hover when click event is replayed.
This is to improve the replay of some programmatic click, such as
E2E tests.
2026-04-01 12:00:00 +08:00
yz-yu
ca61d6b19e fix remove node observer and check on the result of getNode (#43)
* check removed node and its parent before collect

* add more more checks on the result of getNode
2026-04-01 12:00:00 +08:00
Yanzhen Yu
e4cb91e1e6 fix block strategy
If an element was blocked, its child nodes should also be blocked.
The interactions and mutations on the element and its child nodes
also need to be blocked.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
b093fa6015 fix some safari's scroll related issue 2026-04-01 12:00:00 +08:00
Yanzhen Yu
56aca3c2b7 check is dropped and is removed by ancestors instead of only check parent 2026-04-01 12:00:00 +08:00
Yanzhen Yu
86beabd2bb resolve #1 add ignore and block strategy for privacy purpose 2026-04-01 12:00:00 +08:00
Yanzhen Yu
09f30d2a81 return stopper function as the result of record 2026-04-01 12:00:00 +08:00
Yanzhen Yu
fdcf1d0bb2 update dependencies
In this commit, we updated rrweb-snapshot to 0.6.0 which including
a breaking change in data structure.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
7a57784daf Implement #2: simulate hover event 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c18626bf5a fix mutation filter in recorder and change the order of apply mutations in replayer
This change include two critical fix for both recorder and replayer.

In the recorder, previously we filter text and attribute mutations by check its target id,
but this was a wrong approach because removed node also has id at the callback moment.
We corrected this by checking whether the mirror map still has the target id in its keys.

In the replayer side, the issue was we got exceptions when calling insertBefore which says
the ref node was not the child node of the caller node. This will happen when the previous
or next sibling has been removed in the same callback but the previousId or nextId was
recorded.
After apply remove node mutations before add node mutations, we can make sure the removed
siblings will not exist in the mirror map when apply add node mutations. When we get node
from mirror map with an removed id, we will get null and pass it to insertBefore which
is valid.
As a side note, this apply order is safe because we ensured all the remove node mutations
do not include removing newly added nodes in the same callback.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
6ce32f7994 filter text and attributes mutations which target tot a removed node 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7c35cb2f49 check added nodes from removed nodes and dropped nodes 2026-04-01 12:00:00 +08:00
Yanzhen Yu
aa3e2f02ed rewrite mutation observer handler with lazy child list calculation 2026-04-01 12:00:00 +08:00
Yanzhen Yu
487f1d0c9a add meta event and fix childList observer, also update related replayer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
4446e27899 fix scroll value and record viewport when loaded 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c96052d8a4 add input event observer and hook the value setter 2026-04-01 12:00:00 +08:00
Yanzhen Yu
ad2ac811a3 serialize newly added nodes and update id node map when childList changed 2026-04-01 12:00:00 +08:00
Yanzhen Yu
ee4fc3ce7e add scroll and viewport resize observers 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7078ce2f2a add mouse interactions observer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
61312a0ad0 add mouse movement observer 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d2175eae87 change observed mutations into serializable records 2026-04-01 12:00:00 +08:00