Commit Graph

1097 Commits

Author SHA1 Message Date
Pravin Tiwari
7dca0f37c4 fix the statement which is getting changed by Microbundle (#1156)
* fix the statement which is getting changed by microbundle

* Create chatty-cherries-train.md

* fix formatting.

* fix position of comment

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
acffc1a1e2 Replay fix for Firefox — add <head> and <body> separately (#1133)
* Firefox fix: Allow the <head> and <body> to be added in two stages so that (presumably) stylesheet rules are ready to be applied when the body appears

The css which triggered the bug was simply

{
  margin-left: 220px;
  transition: margin-left .448s;
}

* Add a test case which can only be appreciated if you record against this file://, save the events to a html file, and then open the file in Firefox (without this PR applied)

* Apply formatting changes

* Ensure we don't apply this branch when using rrdom, where it is not necessary

* Apply formatting changes

* Rewrite insertion in order to be compatible with rrdom

Also easier to understand

* Delete transition.html

* Create grumpy-ways-own.md

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Neil Han
9ccc8b3e69 chore: web-extension vite.config.ts needs these changes to work for node 14 (#1146) 2026-04-01 12:00:00 +08:00
Yun Feng
0d6be523a4 fix: isCheckout is not included in fullsnapshot event (#1141)
* fix: isCheckout is not included in fullsnapshot event

* add change log
2026-04-01 12:00:00 +08:00
Ben White
7a372f1017 fix: Recursive logging bug with console recording (#1136)
* fix: Recursive logging bug with console recording

* Create violet-melons-itch.md
2026-04-01 12:00:00 +08:00
Prateek Karnal
678ba5b467 Fix relative path detection in stylesheet URLs (#1130)
* Fix relative path detection in stylesheet URLs

* Add a check for www.

* Update packages/rrweb-snapshot/src/snapshot.ts

* Update packages/rrweb-snapshot/src/snapshot.ts

* Create large-ants-prove.md

* Update large-ants-prove.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
github-actions[bot]
f0240ff80c Version Packages (alpha) (#1135) 2026-04-01 12:00:00 +08:00
Yun Feng
617e63c483 some minor changes for releasing the extension and revert failed publish PR #1123 (#1132)
* improve extension bundle

* Revert "Version Packages (alpha) (#1123)"

This reverts commit 39f8c24f1d.
2026-04-01 12:00:00 +08:00
Justin Halsall
6c9ff8183a Fix broken changeset release action (#1134)
* Fix broken changeset release action

* Create mighty-frogs-sparkle.md
2026-04-01 12:00:00 +08:00
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