Commit Graph

58 Commits

Author SHA1 Message Date
Yanzhen Yu
ec8473b5e4 ignore prefetch and preload script links
related to:
1. https://github.com/rrweb-io/rrweb/issues/52
2. https://github.com/rrweb-io/rrweb/issues/297
3. https://github.com/rrweb-io/rrweb/issues/597
2026-04-01 12:00:00 +08:00
AssafKr
3c7aeb3b13 Handle quoted strings in data url (#84)
* handle quoted strings in data url

* unrefactor

* update package json

* Revert "update package json"

This reverts commit 9446109b0f94d9e569a961642f1e57b1a67793ee.

* change background-image to border-image
2026-04-01 12:00:00 +08:00
Eoghan Murray
f2c5ab096e Improve parsing of srcset according to whatwg spec (#74)
* Improve parsing of srcset according to whatwg spec; e.g. srcset="http://example.com/size400,300/img.jpg 640w"

* Trim/normalise the output in order to conform to prior version; solely to keep tests happy

* Add test case for embedded commas in a srcset url as well as support for future possible parenthesis in descriptor string

* Drop 'future proof' test as it causes an error message in test output
2026-04-01 12:00:00 +08:00
re-fort
89cdf67234 Enable to mask texts (#73)
* chore: reorder options

* feat: enable 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
2026-04-01 12:00:00 +08:00
Justin Halsall
74706eeac6 Speed up addHoverClass on large stylesheets (#72)
* speed up addHoverClass on large style sheets

* longer strings first to prevent accidental partial matches

* can add hover class when there is a multi selector with the same prefix

* tweak performance
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
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
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
c7966070ef fix https://github.com/rrweb-io/rrweb/issues/395 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
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
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
Yanzhen Yu
79f1ba574a close #42 fallback to html when doctype is invalid 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
James Bradley
bfaff6b0e1 H tags (#28)
* Failing test

* Allow numbers in el name tests

* Allow numbers in el names
2026-04-01 12:00:00 +08:00
Yanzhen Yu
35070d9dcc add media state check 2026-04-01 12:00:00 +08:00
Filip Slatinac
44eddcc900 added cssText check (#23)
* added cssText check

* added testing
2026-04-01 12:00:00 +08:00
Filip Slatinac
5c23514fca replacing invalid tag names by div (#22) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
5c214f42b8 add picture tag test 2026-04-01 12:00:00 +08:00
Filip Slatinac
1467f97f43 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
2026-04-01 12:00:00 +08:00
Yanzhen Yu
1fc66ffcc5 fix data url regexp 2026-04-01 12:00:00 +08:00
Yanzhen Yu
21e8affa2b Use css parser to add hover class name to selectors.
Previously we use a regexp to match all the CSS selectors and add
our hover class name to it, which has been proved not solid and
may be very slow in some situation.
Using a production ready css parser can handle this better and also
provide ability's to do more accurate things to the recorded
stylesheets.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
c4da047b9f add inline option which can bypass the inline stylesheet 2026-04-01 12:00:00 +08:00
Whalefreezer
68b97e40a2 add support for css @import rules (#11) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
bd42510e23 update typescript and fix test cases 2026-04-01 12:00:00 +08:00
Sam Mason
e21921a2da Make block css class optional & fix test (#6)
* Make block class optional

* Fix test by removing unexpected space space
2026-04-01 12:00:00 +08:00
Yanzhen Yu
29f2e42978 iterate style element to get css rules string 2026-04-01 12:00:00 +08:00
Yanzhen Yu
67027d8be6 handle empty url path 2026-04-01 12:00:00 +08:00
Yanzhen Yu
205d3b4aeb fix the format and use window.location 2026-04-01 12:00:00 +08:00
Daniël van de Giessen
4ed15164c9 Fixed detection of multiple consecutive CSS URLs without quotes (#4) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
ca8288802f do not add origin before data uri image 2026-04-01 12:00:00 +08:00
Yanzhen Yu
2d1d3596b8 handle block element 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7aa3410aea update the test snapshot 2026-04-01 12:00:00 +08:00
Yanzhen Yu
8b470ab6c8 remove _cssText attribute from style element 2026-04-01 12:00:00 +08:00
Yanzhen Yu
c458db3d8e ignore iframe src attribute 2026-04-01 12:00:00 +08:00
Yanzhen Yu
cdedca1716 complately update relative path regexp 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7cb33bfe80 fix css url regexp 2026-04-01 12:00:00 +08:00
Yanzhen Yu
544ef0b3a3 bump 0.5.6 2026-04-01 12:00:00 +08:00
Yanzhen Yu
2065e00c5d 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.
2026-04-01 12:00:00 +08:00
Yanzhen Yu
efcbd0faf1 add hover class to :hover related css rules 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9ff0ab9451 remove local test code 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9a4c21c30f refactor rebuild implementation which mount DOM onto the target document object 2026-04-01 12:00:00 +08:00
Yanzhen Yu
19eca4da6d use document object from params instead of the one in the current scope 2026-04-01 12:00:00 +08:00
Yanzhen Yu
349d78e02b fix style content url normalizer and add some tests 2026-04-01 12:00:00 +08:00
Yanzhen Yu
f3b456270b update README and add travis 2026-04-01 12:00:00 +08:00
Yanzhen Yu
875385552d impl the extra child data attribute to align id map 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e7753e1c24 change relative path into absolute path 2026-04-01 12:00:00 +08:00
Yanzhen Yu
87ff591cd1 use jest-snapshot to apply the snapshot testing 2026-04-01 12:00:00 +08:00
Yanzhen Yu
0434129b00 return id node map when rebuild 2026-04-01 12:00:00 +08:00