Commit Graph

44 Commits

Author SHA1 Message Date
Yanzhen Yu
2af6e7af7f export the transform attribute method 2019-11-09 15:28:04 +08:00
Yanzhen Yu
0b3b630c60 format code 2019-11-09 15:21:36 +08:00
吴泽康
358d5e0d50 Add canvas image content support (#20)
* Add canvas image content support

* use rr_dataURL as the key so we know its a rrweb-added attribute.

* fix canvas rr_dataURL rebuild
2019-10-12 17:02:24 +08:00
Filip Slatinac
30bbd9e21d Added srcset support (#18)
* added src set as a parsed attribute

* added tests

* changed to /a

* added multiple attribute handling

* added better comment

* made snapshot ignore invalid input as if it is invalid input in the original DOM, it should stay invalid in the recreated DOM

* added extra absolute test case

* code style

* addressed comments
2019-10-01 11:32:50 +08:00
Yanzhen Yu
a69791b7f5 fix data url regexp 2019-08-31 16:13:02 +08:00
Yanzhen Yu
13a2985d48 pass mask all input option recursively 2019-08-11 20:43:09 +08:00
Yanzhen Yu
b22ccd6bc0 fix #14 fix innerText cap issue 2019-08-04 14:40:54 +08:00
Yanzhen Yu
77c7053751 add mask all inputs option to snapshot 2019-06-15 14:41:36 +08:00
Yanzhen Yu
40da9ffa2f format code 2019-05-26 16:05:47 +08:00
Benoît Zugmeyer
5697c689d9 reuse serialized nodes ids (#12)
* reuse serialized nodes ids

With this patch, each DOM node keeps its id during its existence. This
allows to apply RRWeb events to previous snapshots if needed.

`resetId` has been removed because it loses its meaning: calling it
would not reset the existing nodes ids anymore, only the new ones.

Since we don't reset the id anymore, we may exhaust the available ids
quicker, but Number.MAX_SAFE_INTEGER (2 ** 53 - 1) is pretty large, so I
doubt this'll cause any problem.

* improv TS typing

The `nAsINode` variable was not very elegant.  Simplify this by removing
the cast, and make the INode interface compatible with Node.

* update typings
2019-05-21 17:55:43 +08:00
Yanzhen Yu
0f30dc288c pass inline stylesheet option to iteratly 2019-05-12 21:06:38 +08:00
Yanzhen Yu
724b67f166 add inline option which can bypass the inline stylesheet 2019-05-12 16:04:14 +08:00
Whalefreezer
78c8c11e6b add support for css @import rules (#11) 2019-05-06 21:56:33 +08:00
Yanzhen Yu
6218745a75 update typings 2019-04-14 15:59:22 +08:00
Yanzhen Yu
171d7b39b6 accept RegExp type block class config 2019-04-14 15:55:34 +08:00
Sam Mason
03c9fde822 Make block css class optional & fix test (#6)
* Make block class optional

* Fix test by removing unexpected space space
2019-04-01 10:30:52 +08:00
Yanzhen Yu
687c710fe9 iterate style element to get css rules string 2019-02-17 16:34:28 +08:00
Yanzhen Yu
c4c147649c handle empty url path 2019-01-24 18:39:57 +08:00
Yanzhen Yu
7c275cbf2c fix the format and use window.location 2018-12-30 21:50:04 +08:00
Daniël van de Giessen
91e031844e Fixed detection of multiple consecutive CSS URLs without quotes (#4) 2018-12-30 13:36:17 +08:00
Daniël van de Giessen
056b317116 Parse style attributes for absolute URL paths (#5) 2018-12-30 13:19:31 +08:00
Yanzhen Yu
922be70f54 do not add origin before data uri image 2018-12-27 12:44:52 +08:00
Yanzhen Yu
b7b38c3a2b delete not needed props 2018-12-02 23:15:48 +08:00
Yanzhen Yu
d8c5ae5ae6 handle block element 2018-12-02 23:06:36 +08:00
Yanzhen Yu
f73bad21e5 complately update relative path regexp 2018-11-26 17:42:52 +08:00
Yanzhen Yu
66e8d4318c fix absolute to doc 2018-11-23 23:36:19 +08:00
Yanzhen Yu
124959a67d fix css url regexp 2018-11-23 23:02:35 +08:00
Yanzhen Yu
49c1ba0a1f absolute relative path in inline stylesheet 2018-11-23 22:47:19 +08:00
Yanzhen Yu
8157b38f99 check is svg when serialization 2018-11-13 16:09:57 +08:00
Yanzhen Yu
216d03dae3 Fix the regexp performance issue
Also move the addHoverClass implementation into the rebuild stage.
So if there is still some corner case we have not handled, it will
only affect the replayer part of rrweb.
2018-11-01 11:36:25 +08:00
Yanzhen Yu
7f806128ed add hover class to :hover related css rules 2018-10-31 19:02:26 +08:00
Yanzhen Yu
2a50fff366 allow skip child when serialize node and rebuild node 2018-10-22 23:03:10 +08:00
Yanzhen Yu
508bbdfc26 refactor rebuild implementation which mount DOM onto the target document object 2018-10-22 10:34:23 +08:00
Yanzhen Yu
416c1eec9a fix style content url normalizer and add some tests 2018-10-18 19:42:01 +08:00
Yanzhen Yu
43b2290f5f export reset id function 2018-10-18 16:13:59 +08:00
Yanzhen Yu
e461136f71 impl the extra child data attribute to align id map 2018-10-16 15:18:07 +08:00
Yanzhen Yu
eef6a6e389 change relative path into absolute path 2018-10-16 12:11:00 +08:00
Yanzhen Yu
d59ba817cb export serializeNodeWithId so rrweb could serialize newly added nodes 2018-10-09 10:51:30 +08:00
Yanzhen Yu
f143eee54a return id node map when snapshot 2018-10-08 15:35:03 +08:00
Yanzhen Yu
978e12b089 add strict null check and fix codes 2018-10-08 11:20:48 +08:00
Yanzhen Yu
bfe431e99a add iframe tests and update urls in test file 2018-10-06 10:13:33 +08:00
Yanzhen Yu
8b82981b62 try to inline linked stylesheet when in same origin 2018-10-05 23:06:51 +08:00
Yanzhen Yu
05e4103f7a replace script tag with noscript and inline the states of form field components 2018-09-30 17:38:44 +08:00
Yanzhen Yu
3edd364c3b basic rebuild implementation 2018-09-30 15:26:00 +08:00