Commit Graph

194 Commits

Author SHA1 Message Date
Yanzhen Yu
e92d92b0b6 add isShadow flag if a node is under shadow root 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d79922f6b6 update typings 2026-04-01 12:00:00 +08:00
Yanzhen Yu
697be5acf7 Release 1.1.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
105268f472 snapshot and rebuild shadow DOM
https://github.com/rrweb-io/rrweb/issues/38
2026-04-01 12:00:00 +08:00
Yanzhen Yu
af000d4a7a add typings script to prepack 2026-04-01 12:00:00 +08:00
Eoghan Murray
be2648054c Found an example in the wild of the deprecated pre-css way of adding a background image to table cells (#69) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7cb4a25597 using for loop instead of forEach in element classlists
pick #64 and close #68
2026-04-01 12:00:00 +08:00
Province Innovation
c09ee435d8 Valid tag names can include any digit [0-9] (#66) 2026-04-01 12:00:00 +08:00
Justin Halsall
17b1821a15 Adding prepare & prepack npm statement (#67)
* Add prepare & prepack

* Create .npmignore

* remove node_modules, they might be needed
2026-04-01 12:00:00 +08:00
Yanzhen Yu
3d463d219c Release 1.0.7 2026-04-01 12:00:00 +08:00
Yanzhen Yu
d449a1263d safe access iframe document 2026-04-01 12:00:00 +08:00
Yanzhen Yu
4d186077f4 Release 1.0.6 2026-04-01 12:00:00 +08:00
Yanzhen Yu
a5d77ea4f0 add iframe load timeout 2026-04-01 12:00:00 +08:00
Yanzhen Yu
59c849e429 Release 1.0.5 2026-04-01 12:00:00 +08:00
yz-yu
b0508d4df4 nested record iframe (#63)
* pick nested branch

* iframe snapshot

* temp: add bundle file to git

* revert ignore file

* refactor iframe impl
1. do callback one iframe is loaded, let rrweb handle the rest
2. handle iframe as normal element in rebuild

* rename hook function
2026-04-01 12:00:00 +08:00
Yanzhen Yu
f780c42b95 Release 1.0.4 2026-04-01 12:00:00 +08:00
Yanzhen Yu
af61cab872 fix href value 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c24e610f9e Release 1.0.3 2026-04-01 12:00:00 +08:00
丶Cccccc
53f51e0e8e bugfix: svg url中id name被误转为绝对路径 (#59)
Co-authored-by: wanglei002 <wanglei002@sensorsdata.cn>
2026-04-01 12:00:00 +08:00
cgf
451bf457cc svg xlink:href 路径问题 (#55)
* feat: 修改在svg , xlink:href 相对路径改为绝对路径

* feat: 修改在svg , xlink:href 路径

* feat: 修改在svg, 图片路径问题

* feat: 修改在svg, 图片路径问题

* feat: 修改在svg , xlink:href 路径

Co-authored-by: caogf <caogf@guahao.com>
2026-04-01 12:00:00 +08:00
Yanzhen Yu
3f406ea5ce Release 1.0.2 2026-04-01 12:00:00 +08:00
Yanzhen Yu
3a946702c2 fix https://github.com/rrweb-io/rrweb-snapshot/issues/56
safe access tagName of form element
2026-04-01 12:00:00 +08:00
Yanzhen Yu
93be66e22a Release 1.0.1 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c7966070ef fix https://github.com/rrweb-io/rrweb/issues/395 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e65160697b Release 1.0.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
a9ef2cfa83 refactoring public API 2026-04-01 12:00:00 +08:00
Yanzhen Yu
6852da5fe5 close #38, update data uri regexp 2026-04-01 12:00:00 +08:00
Yanzhen Yu
40d754884a fix lint 2026-04-01 12:00:00 +08:00
Yanzhen Yu
288beb6cb2 Release 0.8.4 2026-04-01 12:00:00 +08:00
Karl-Aksel Puulmann
0c62d31002 Allow blocking elements by selector (#50)
* Extract method (isElementBlocked) and add tests

* Add blockSelector argument to snapshot

If blockSelector is passed, it will be matched against the element.

Reasoning: Mutating class names can get messy, so providing another hook
helps keep code clean by using data-attributes instead.
2026-04-01 12:00:00 +08:00
Eoghan Murray
65671be739 Add ability to reset the mapping id, to facilitate destructor in rrweb (rrwebRecord.stop) (#49) 2026-04-01 12:00:00 +08:00
Eoghan Murray
b005450c64 Prefer a map and a join as feel it's easier to understand, and I found a case in the wild where Array.prototype.reduce was overwritten (which admittedly is also a danger with map) (#52) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f9f9e9cecd Release 0.8.3 2026-04-01 12:00:00 +08:00
Yanzhen Yu
40cf712cfd update typings 2026-04-01 12:00:00 +08:00
Eoghan Murray
28917d1c9a Preserve url quotes (#47)
* Preserve original quotes when rewriting CSS url() paths - important for inline SVG files which often have spaces

* Found an example in the wild with the 'charset=' part left off. This is supported by https://css-tricks.com/lodge/svg/09-svg-data-uris/ ... not sure why we aren't just testing for the 'data:' prefix here?

* Not sure why this is now coming back with a double quote after recent changes here; it's supposed to preserve the single quote from style.css??
2026-04-01 12:00:00 +08:00
Eoghan Murray
71b6e683c0 Add a slimDOM option to strip out unnecessary parts of the DOM (#36)
* Add a `slimDOM` option to strip out unnecessary parts of the DOM in terms of replay

 - <script> tags in the <head> take up unnecessary storage space and are often injected semi randomly to become a source of unnecessary variation between recordings of the same thing
 - comment tags can be stripped out without affecting display
 - future: this option could also turn on more aggressive stripping, e.g. elements that are hidden by CSS (assuming we can handle them becoming visible after mutation events)

* Mark nodes ignored due to slimDOM option, so that they can also be ignored by the mutation observer in rrweb

* Introducing the `ignored` attribute violates the `serializedNodeWithId` type

* slimDOM: Strip out whitespace nodes from <head> element as they have no effect but take up space

 - these would otherwise have to be merged after <script> elements are removed; for statcounter usecase, removing
   <script> elements is no good if there is still a trace of their presence due to the white space (and hence a variant <head> node is still produced)
 - I explored a more radical stripping of all white space nodes, but there is a problem if parent node is <pre> or otherwise rendered with `white-space: pre` and similar.
   detecting applied styles with getComputedStyle would be very expensive (I haven't measured it though)

* Export IGNORED_NODE as a constant instead of relying on the hard-to-grok `-2`

* Remove <link rel=preload as=script> which are similarly as useless as <script> tags

* Make slimDOM configurable with the expecations that `slimDOMOptions: true` will only enable non-destructive options (so not all options may be turned on)

* Expand slimDOM to add options to remove more elements from the <head> that should not be necessary in the replayer context
2026-04-01 12:00:00 +08:00
Yanzhen Yu
d8ba0cc8e2 Release 0.8.2 2026-04-01 12:00:00 +08:00
Yanzhen Yu
79f1ba574a close #42 fallback to html when doctype is invalid 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c43189d3fe Release 0.8.1 2026-04-01 12:00:00 +08:00
Yanzhen Yu
287a6073c0 add an option to enable/disable take canvas snapshot 2026-04-01 12:00:00 +08:00
Yanzhen Yu
41868e2265 rename visit to visitSnapshot 2026-04-01 12:00:00 +08:00
Yanzhen Yu
52aac74fa2 add visit function for snapshot 2026-04-01 12:00:00 +08:00
Yanzhen Yu
29fcf03d4f provide a general visit function to modify rebuilt id node map 2026-04-01 12:00:00 +08:00
Eoghan Murray
cd601571ea Expand what is considered to be a valid tag name to include underscores: (#41)
- was making this change for <wix-image> on Wix websites, but discovered after that this has already been done in e4593ff76d
 - have tested document.createElement('wix-image') and document.createElement('foo_bar'), but can't find a canonical source for what is allowed in tag names.
 - this restriction was originally introduced in #150 to prevent document.createElement('alt=""') i.e. a very malformed tag name
2026-04-01 12:00:00 +08:00
Jason Barry
949c236e29 Fixes missing space when converting srcset to use absolute URLs (#40)
* Fixes missing space when converting srcset to use absolute URLs

* Fix integration snapshot
2026-04-01 12:00:00 +08:00
吴泽康
1c43577807 Add nested scroll support (#31) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
ec7e944a3d add textarea and select to default options 2026-04-01 12:00:00 +08:00
Yanzhen Yu
77aa87fc49 Release 0.8.0 2026-04-01 12:00:00 +08:00
Yanzhen Yu
8592fbd05b support mask select fields 2026-04-01 12:00:00 +08:00
Yanzhen Yu
80ef6a4007 Release 0.7.29 2026-04-01 12:00:00 +08:00