Commit Graph

369 Commits

Author SHA1 Message Date
Yanzhen Yu
8d8e70400b make sure rrweb do not use browser API in static stage 2020-09-20 14:15:19 +08:00
Justin Halsall
65d0d4e54a child nodes without __sn now remove without error (#307) 2020-09-20 12:58:23 +08:00
Yanzhen Yu
9049f2aef1 close #350 catch error may caused by checkout feature 2020-09-20 12:47:43 +08:00
Yanzhen Yu
9a3e1fe724 fix last played timestamp when it is a mousemove event 2020-09-20 12:37:20 +08:00
Yanzhen Yu
2440701926 impl #309 observe font face set changes 2020-09-17 02:11:34 +08:00
Yanzhen Yu
412f6ca95e Release 0.9.4 2020-09-16 22:57:20 +08:00
Yanzhen Yu
a68684d881 clean up __ln property when remove node 2020-09-16 17:28:07 +08:00
Yanzhen Yu
81c2e547d8 Release 0.9.3 2020-09-12 17:37:47 +08:00
Yanzhen Yu
3abb2981ec close #322 hook select element selectedIndex property 2020-09-12 17:28:29 +08:00
Yanzhen Yu
8519329e90 close #336 add pointer-events: null to mouse tail wrapper 2020-09-12 15:49:41 +08:00
Yanzhen Yu
dbe1c12cc2 update #324, fix typo 2020-09-12 15:49:15 +08:00
Yanzhen Yu
91dc54c7b8 close #342 send SET_SPEED event when setConfig 2020-09-12 15:12:23 +08:00
Yanzhen Yu
52e257627d Release 0.9.2 2020-09-07 22:02:27 +08:00
Yanzhen Yu
41690c755c close #330 implement more accurate finish event 2020-09-07 21:59:57 +08:00
Yanzhen Yu
0688bb6353 close #51 add mouse tail feature 2020-09-07 14:52:57 +08:00
Yanzhen Yu
0256bea4bc hide iframe before first meta event 2020-09-07 12:52:09 +08:00
Yanzhen Yu
c8094c33dc Release 0.9.1 2020-09-07 09:47:17 +08:00
Yanzhen Yu
9b8c7f755f close #161 support "addEvent" in any state 2020-09-07 09:44:03 +08:00
Yanzhen Yu
1bc5aaeb01 close #300 upgrade rrweb-snapshot 2020-09-06 21:34:25 +08:00
Yanzhen Yu
1e4df37093 close #215 catch delete rule errors 2020-09-06 18:47:08 +08:00
Yanzhen Yu
f52b02f4b1 close #319 handle undefined nextId
Looks like some serializer will omit field with null value, so we
do some checks in the replayer to avoid of dead loop.
2020-09-06 18:24:27 +08:00
Yanzhen Yu
cdebe18803 close #320 use emitter handler to catch before load state 2020-09-06 18:14:11 +08:00
Yanzhen Yu
9f6f9a8c47 close #303 use a fork version of smooth scroll polyfill
The forked version support customize target window and document,
so we can polyfill it to the iframe.
2020-09-06 17:34:29 +08:00
Yanzhen Yu
fa6fd6e2b9 catch unexpected errors during replay media interactions 2020-09-06 17:34:29 +08:00
Justin Halsall
df6d08db97 Only trigger waitForStylesheetLoad if not seeking (#326) 2020-09-06 16:49:44 +08:00
Justin Halsall
6934fab78d Update lastPlayedEvent in live mode (#327)
* Update lastPlayedEvent in live mode

* tricking travis-ci into running again
2020-09-05 17:26:48 +08:00
Justin Halsall
e717cda658 Fix live mode (#310)
* add failing test

* paused -> live now possible
2020-08-27 21:33:12 +08:00
yz-yu
772c0e021a record canvas mutations (#296)
* record canvas mutations

close #60, #261

This patch implements the canvas mutation observer.
It consists of both the record and the replay side changes.

In the record side, we add a `recordCanvas` flag to indicate
whether to record canvas elements and the flag defaults to false.
Different from our other observers, the canvas observer was
disabled by default. Because some applications with heavy canvas
usage may emit a lot of data as canvas changed, especially the
scenarios that use a lot of `drawImage` API.
So the behavior should be audited by users and only record canvas
when the flag was set to true.

In the replay side, we add a `UNSAFE_replayCanvas` flag to indicate
whether to replay canvas mutations.
Similar to the `recordCanvas` flag, `UNSAFE_replayCanvas` defaults
to false. But unlike the record canvas implementation is stable and
safe, the replay canvas implementation is UNSAFE.
It's unsafe because we need to add `allow-scripts` to the replay
sandbox, which may cause some unexpected script execution. Currently,
users should be aware of this implementation detail and enable this
feature carefully.

* update canvas integration test
2020-08-22 16:44:02 +08:00
Justin Halsall
a9719e302e Add regression tests and pause(timeOffset) test (#288)
* increase timeout from 2 (default to 10 seconds

* add regression tests for playing multiple times

* add pause at tests
2020-08-20 15:05:25 +08:00
yz-yu
5d83ee39fd close #280. Improve the performance of the DOM mutation observer. (#284)
This issue was originally reported in #280 but may also relate
to #167 and other potential performance issues in the recording.

In #206 I implemented the new mutation observer which will defer
the serialization of DOM, which helps us to have a consistent DOM
order for the replay.

In this implementation, we use an array to represent the `addQueue`.
Whenever we need to consume the queue, we will iterate it to make
sure there is no dead loop, and then shift the first item to see
whether it can be serialized at the new timing.

But this implementation may be very slow when there are a lot of newly
added DOM since it will do an O(n^2) iteration.

For example, if we have three newly added DOM `n1`, `n2`, `n3`,
the iteration looks like this:
```
[n1, n2, n3]
	n1 -> n2 -> n3, consume n3
[n1, n2]
	n1 -> n2, consume n2
[n1]
	n1, consume n1
```
We should have a better performance if te iteration looks like this:
```
[n1, n2, n3]
	n3, consume n3
[n1, n2]
	n2, consume n2
[n1]
	n1, consume n1
```

Simply reverse the mutation payload does not work, because it does
not always as same as the DOM order.

So in this patch, we replace the `addQueue` with a double linked list,
which can:
1. represent the DOM order in its data structure
2. has an O(1) time complexity when looking up the sibling of a list item
3. has an O(1) time complexity when removing a list item
2020-08-16 14:47:25 +08:00
Yanzhen Yu
5e9e1a2522 Release 0.9.0 2020-08-09 13:10:55 +08:00
Yanzhen Yu
be4cccd6e3 close #268 subscribe latest player state before resume 2020-08-09 13:05:55 +08:00
Yanzhen Yu
006b709c00 remove the internal use of resume API 2020-08-09 13:03:12 +08:00
Yanzhen Yu
54baa27b36 remove global body style 2020-08-09 12:50:38 +08:00
Yanzhen Yu
a90999d96e close #274 implement the new state management proposal 2020-08-08 17:07:37 +08:00
Eoghan Murray
6e53410e2b Reset the lastPlayedEvent as it would otherwise be used to discard events in machine.ts as follows: (#250) 2020-07-28 22:52:50 +08:00
Yanzhen Yu
9d24b8c315 Release 0.8.5 2020-07-23 23:48:09 +08:00
Yanzhen Yu
7802916dfc close #263 Since we improved the block class strategy,
we need to check parent node before pushAdd.
2020-07-23 23:47:03 +08:00
Yanzhen Yu
6a58ff28f9 Release 0.8.4 2020-07-19 08:55:51 +08:00
Yanzhen Yu
6cf3253d94 close #254 hotfix: only use virtual parent in sync mode 2020-07-19 08:54:18 +08:00
Yanzhen Yu
ad32b8be8d close #240 fix block class to handle text node changes 2020-07-18 17:36:33 +08:00
Yanzhen Yu
4ee86743a5 Release 0.8.3 2020-07-18 16:57:57 +08:00
Yanzhen Yu
6f08ec3ca7 add the patch function to utils 2020-07-18 16:56:22 +08:00
Yanzhen Yu
c5580f97f4 close #228 safe access content document, which may be destroyed manually 2020-07-18 15:29:01 +08:00
Yanzhen Yu
0756319b8e close #244 pass fullsnapshot event to the callback 2020-07-18 15:16:59 +08:00
Yanzhen Yu
d7a1b0c9e3 fix unit tests 2020-07-18 15:07:47 +08:00
yz-yu
7de7eb5e54 mask input options and sampling options (#252)
* part of #80, support mask input options

* close #188 enhance sampling options
Use a more general sampling strategy interface to describe the
configuration of sampling events collection.

Implemented mousmove, mouse interaction, scroll and input sampling
strategy.
2020-07-18 15:05:19 +08:00
Eoghan Murray
286b520907 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
2020-07-16 00:12:37 +08:00
yz-yu
e2cc42e393 fix the skip event calculation (#242) 2020-07-11 17:06:56 +08:00
Yanzhen Yu
3e2b596664 tweak the code of getting last session, without splice events array 2020-07-11 11:03:40 +08:00