Commit Graph

1088 Commits

Author SHA1 Message Date
github-actions[bot]
0d07e5eb4b Version Packages (alpha) (#1123)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Billy Vong
c1e7fe9344 fix: Exclude scripts loaded with rel=modulepreload from snapshots (#1128)
* fix: Exclude `modulepreload` as well

We were only excluding `<link rel="preload" as="script" />` but we should include `rel="modulepreload"` as well

* Apply formatting changes
2026-04-01 12:00:00 +08:00
Justin Halsall
10301288e4 Chore: Bump up all package versions together whenever any one version changes (#1131)
* Bump up all package versions together whenever any one version changes.

Keeps everything in sync to make it easy to see if you have the correct dependencies.

https://github.com/changesets/changesets/blob/main/docs/fixed-packages.md

* Empty changeset as this changes nothing for the packages them selves

* Bring @rrweb/web-extension version inline with other packages

* separate the extension version from package.json's to avoid errors

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Yun Feng
8edace971d improve rrdom performance (#1127)
* add more check to rrdom to make diff algorithm more robust

* fix: selector match in iframe is case-insensitive

add try catch to some fragile points

* test: increase timeout value for Jest

* improve code style

* fix: failed to execute insertBefore on Node in the diff function

this happens when ids of doctype or html element are changed in the virtual dom

also improve the code quality

* refactor diff function to make the code cleaner

* fix: virtual nodes are passed to plugin's onBuild function

* refactor the diff function and adjust the order of diff work.

* call afterAppend hook in a consistent traversal order

* improve the performance of the "contains" function

reduce the complexity from O(n) to O(logn)
a specific benchmark is needed to add further

* add a real events for benchmark

* refactor: change the data structure of childNodes from array to linked list

* remove legacy code in rrweb package

* update unit tests

* update change log
2026-04-01 12:00:00 +08:00
Yun Feng
b837600e80 rrweb extension implementation (#1044)
* feat: add rrweb web-extension package

* refactor: make the extension suitable for manifest v3

* update tsconfig.json

* use version_name rather than recorder_version in manifest.json

* update manifest.json

* enable to keep recording after changing tabs

* enable to record between tabs and urls

* fix CI error

* try to fix CI error

* feat: add pause and resume buttons

* feat: add a link to new session after recording

* improve session list

* refactor: migrate session storage from chrome local storage to indexedDB

* feat: add pagination to session list

* fix: multiple recorders are started after pausing and resuming process

* fix: can't stop recording on firefox browser

* update type import of 'eventWithTime'

* fix CI error

* doc: add readme

* Apply suggestions from Justin's code review

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>

* refactor: make use of webNavigation API to implement recording consistent during page navigation

* fix firefox compatibility issue and add title to pages

* add mouseleave listener to enhance the recording liability

* fix firefox compatibility issue and improve the experience of recording resume after closing tabs

* update tsconfig

* upgrade vite-plugin-web-extension config to fix some bugs on facebook web page

* update import links

* refactor: cross tab recording mechanism

apply Justin's suggestion

* refactor: slipt util/index.ts into multiple files

* implement cross-origin iframe recording

* fix: regression of issue: ShadowHost can't be a string (issue 941)

* refactor shadow dom recording to make tests cover key code

* Apply formatting changes

* increase the node memory limitation to avoid CI failure

* Create lovely-pears-cross.md

* Apply formatting changes

* Update packages/web-extension/package.json

* Update .changeset/lovely-pears-cross.md

* update change logs

* delete duplicated property

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
e5c0eae352 refine change logs (#1126) 2026-04-01 12:00:00 +08:00
Yun Feng
c6e9b724d0 fix duplicated shadow dom (#1095)
* fix: duplicated elements in shadow doms

clean observers before taking new full snapshots

* add checker for replayer to make it stable when data has duplicated nodes

* apply review suggestions

* add change log

* Apply formatting changes

* update prettier to fit the master branch

---------

Co-authored-by: Mark-Fenng <Mark-Fenng@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
7fb0e4ca6a Add needed dependency for changeset formatter (#1125) 2026-04-01 12:00:00 +08:00
Justin Halsall
880a9e4c48 Add friendly changelog message (#1124)
* Add friendly changelog message

* add empty changelog
2026-04-01 12:00:00 +08:00
Yun Feng
781214a4e7 fix: outdated ':hover' styles can't be removed from iframes or shadow doms (#1121)
* fix :hover class can't be removed in iframes

* add test case and change log
2026-04-01 12:00:00 +08:00
Yun Feng
55c39c3c92 add change log and update readme (#1122) 2026-04-01 12:00:00 +08:00
Justin Halsall
27caffecff Automate NPM package releases (#1119) 2026-04-01 12:00:00 +08:00
Yun Feng
19be06d936 fix: mutation Failed to execute 'insertBefore' on 'Node': Only one doctype on document allowed (#1112)
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
a6da9ba8d0 add option to record on DOMContentLoaded event (#1109) 2026-04-01 12:00:00 +08:00
Yun Feng
306da78607 enable to customize logger in the replayer (#1111) 2026-04-01 12:00:00 +08:00
Yun Feng
12c2671644 improve rrdom robustness (#1091) 2026-04-01 12:00:00 +08:00
Yun Feng
a9c01eb8d0 fix: regression of issue: ShadowHost can't be a string (issue 941) (#1092) 2026-04-01 12:00:00 +08:00
Eoghan Murray
bc2b945436 Don't have requestAnimationFrame looping in background for Live Mode (#1098) 2026-04-01 12:00:00 +08:00
Yun Feng
d5ff6efc9a fix: wrong rootId value in special iframes (#1100)
1. When some same-origin iframes are nested in cross-origin iframes, their `rootId`s are wrong.

2. The property `rootId` is missing in serialized cross-origin iframes
2026-04-01 12:00:00 +08:00
Francesco Novy
d97c82c41d fix: Ensure CSS support is checked more robustly (#1106)
* fix: Ensure CSS support is checked more robustly

* Apply formatting changes

* apply eslint changes

* Update packages/rrweb/src/record/observer.ts

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>

* fix: do not use window in module scope

---------

Co-authored-by: mydea <mydea@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
0cb2407114 [fix] Don't trigger Finish event when in liveMode (#1115) 2026-04-01 12:00:00 +08:00
James Berry
8af769934f [console-plugin] Feat: Record unhandledrejection event (#1104)
* feat/console-plugin/add-unhandledrejection-handler

* better error

* change the window object to the passed in 'win'

* empty

* improve serialized error messages

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
dependabot[bot]
396de714f6 chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#1108)
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
f2888d8694 Fix cross origin iframe bugs (#1093)
* fix: error data while recording some websites are integrated  with stripe

These websites will usually have an iframe with src "https://js.stripe.com/v3/m-outer-xxx.html"

* add test case for the bug

* fix: recordCrossOriginIframes: true does not work with pack/unpack fn

1. bugfix
2. add test case
3. add rrweb-all.js to the result of command: bundle:browser
4. make puppeteer headless in CI by default to increase the speed and stability
2026-04-01 12:00:00 +08:00
Francesco Novy
529b2ad266 feat: Guard against missing window.CSSStyleSheet (#1088) 2026-04-01 12:00:00 +08:00
Justin Halsall
236d7a3f3c Fix: shadow dom bugs (#1049)
* Add test cases for bugs

* Fix shadow dom recording

When moving an element containing shadow dom
When adding an element to shadow dom before its attached to the dom

* Apply formatting changes

* Refactor in dom checking code

* Nodes don't get processed in more than one mutation buffer

* Constrain node mutations to one mutation buffer per request animation frame

* Make tests less flaky under heavy load

* Apply suggestions from code review

* Update packages/rrweb-snapshot/test/rebuild.test.ts

* Remove unused nodeSet

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
dbseel
e91433bb66 Fix: isBlocked throws on invalid HTML element (#1032) 2026-04-01 12:00:00 +08:00
Yun Feng
7f5310aaec Fix missed adopted style sheets of shadow doms in checkout full snapshot (#1086)
* fix: adoptedStyleSheets in shadow doms are missed when a full snapshot is checked out after recording has started

* fix: avoid removing monkey patch of all existed shadow doms when take a new full snapshot

* Apply formatting changes

* Update packages/rrweb/test/record.test.ts

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>

* fix typo

* update outdated snapshot

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
80ca04ddd6 fix: module error (#1087)
* fix: module error

refactor all suffix of bundled scripts with commonjs module from 'js' to cjs

error:
ReferenceError: exports is not defined in ES module scope
This file is being treated as an ES module because it has a '.js' file extension and '.../rrweb/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.

* update jest config files
2026-04-01 12:00:00 +08:00
dependabot[bot]
eca872e78f chore(deps): bump loader-utils from 1.4.0 to 1.4.2 (#1051)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
dependabot[bot]
71b7a082ee chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 (#1068)
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
dependabot[bot]
1083039282 chore(deps): bump express from 4.17.1 to 4.18.2 (#1076)
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
dependabot[bot]
9200278ee8 chore(deps): bump qs from 6.5.2 to 6.5.3 (#1072)
Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
6e06fd2536 Chore: Make tests less flakey & upgrade puppeteer to rrweb-snapshot test suite to run (#1084)
* Upgrade puppeteer to 17.1.3 in rrweb-snapshot

* Apply formatting changes

* Add ?

* Make tests less flakey

* Make attribute-setting more explicit

* Make test less flakey

* Make test less flakey

* Upgrade puppeteer for rrdom

* Use wait for request animation frame instead of timeout

* Force append to happen in second event

* Wait till iframe was loaded (now 100ms)

* Round the currentTime to 1 decimal place
2026-04-01 12:00:00 +08:00
Eoghan Murray
c62f888ec5 harmonize on a single getWindowScroll (#1054)
* Fix issue where only indication I could see in any attribute that the document was scrolling was on `window.pageYOffset`, so we hadn't been able to replay scrolling

* Apply formatting changes

* Update observer.ts

help you fix typescript error

* Update utils.ts

help you fix typescript error

Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
bad9c131e9 Fix: Catch iframe manager & fix formatting issues (#1083)
* Catch any errors observing iframes

* Fix formatting
2026-04-01 12:00:00 +08:00
Francesco Novy
337e35a77f Handle errors when observing iframes (#1058) 2026-04-01 12:00:00 +08:00
fukang wang
344fb81beb fix: Failed to execute insertBefore on Node (#1042)
Co-authored-by: wangfukang <wangfukang@kuaishou.com>
2026-04-01 12:00:00 +08:00
Francesco Novy
81f9b2b8b9 Export recordOptions type (#1067) 2026-04-01 12:00:00 +08:00
Jimmy Liu
346e02103e Fix muted false -> true not being set 2026-04-01 12:00:00 +08:00
Justin Halsall
da70e914c3 Fix: Post message can break cross origin iframe recording (#1053) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
134d60a98e fix @rrweb prefix package access 2026-04-01 12:00:00 +08:00
Yanzhen Yu
7d64123261 chore(release): publish new version
- rrdom-nodejs@0.1.7
 - rrdom@0.1.7
 - rrweb-player@1.0.0-alpha.4
 - rrweb-snapshot@2.0.0-alpha.4
 - rrweb@2.0.0-alpha.4
 - @rrweb/types@2.0.0-alpha.4
2026-04-01 12:00:00 +08:00
Justin Halsall
2cd3d2afe9 Cross origin iframe support (#1035)
* Add `recordCrossOriginIframe` setting

* Set up messaging between iframes

* should emit full snapshot event from iframe as mutation event

* this.mirror was dropped on attachIframe

* should use unique id for child of iframe

* Cross origin iframe recording in `yarn live-stream`

* Root iframe check thats supported by firefox

* Live stream: Inject script in all frames

* Record same origin and cross origin iframes differently

* Should map Input events correctly

* Turn on other tests

* Fix compatibility with newer puppeteer

* puppeteer vs 12 seems stable without to many changes needed

* normalize port numbers in snapshots

* Handle scroll and ViewportResize events in cross origin iframe

* Correctly map cross origin mutations

* Map selection events for cross origin iframes

* Map canvas mutations for cross origin iframes

* Update snapshot to include canvas events

* Skip all meta events

* Support custom events as best we can in cross origin iframes

* Use earliest version of puppeteer that works with cross origin live-stream

* Map mouse/touch interaction events

* Update snapshots for correctly mapped click events

* Tweak tests for new puppeteer version

* Map MediaInteraction correctly for cross origin iframes

* Make tests consistent between high and low dpi devices

* Make test less flaky

* Make test less flaky

* Make test less flaky

* Make test less flaky

* Add support for styles in cross origin iframes

* Map traditional stylesheet mutations on cross origin iframes

* Add todo

* Add iframe mirror

* Get iframe manager to use iframe mirrors internally

* Rename `IframeMirror` to `CrossOriginIframeMirror`

* Setup basic cross origin canvas webrtc streaming

* Clean up removed canvas elements

* reset style mirror on new full snapshot

* Fix cross origin canvas webrtc streaming

* Make emit optional

* Run tests on github actions

* Upload image artifacts from failed tests

* Use newer github actions

* Test: hopefully adding more wait will fix it

* add extra wait

* Fix image snapshot tests

* Make tests run with new puppeteer version

* upgrade eslint-plugin-jest

* Chore: Remove travis ci as ci's running on github actions

* Chore: Support recording cross origin iframe in repl

* Force developers to update the cross origin iframe mapping when adding new events

https://github.com/rrweb-io/rrweb/pull/1035#discussion_r1012516277

* Document cross origin iframe recording

* Docs: cross origin iframes recording methods

* Docs: AI translated, cross origin iframe recording

* rename getParentId to getId

* Migrate to @rrweb/types

* Run on pull request

* doc: improve Chinese doc

* Rename `parentId` to `Id`

Co-authored-by: Mark-Fenng <f18846188605@gmail.com>
2026-04-01 12:00:00 +08:00
luocongqiu
df5d547446 shadow root use the correct dom in iframe (#1037)
Co-authored-by: luocq3 <luocq3@asiainfo.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
fcb5c036fc Fix: scrolling on elements being is ignored (#1029)
In certain cases when scrollLeft is being set, but the value doesn't change. Then scrollTop is also ignored, even if that value was changed.
In this case we use the `scrollTo` api as it doesn't have that issue.
2026-04-01 12:00:00 +08:00
Justin Halsall
c6ec00b52f Fix: Capture css background-clip: text with browser prefix (#1047) 2026-04-01 12:00:00 +08:00
Justin Halsall
a13f9e8434 Add rrweb-player readme (#1050)
* Add rrweb-player readme

* Apply formatting changes
2026-04-01 12:00:00 +08:00
MF
72d08344c1 fix CI error (#1045)
* fix CI error

* change the CI triggering event to pull_request
2026-04-01 12:00:00 +08:00
MF
25db99495c fix: bug when handling shadow doms (#1041)
On the website https://mixpanel.com/project/2195193/view/139237/app/dashboards#id=3679845, the bottom chart makes the recorder crash (infinite loop)
2026-04-01 12:00:00 +08:00