Commit Graph

84 Commits

Author SHA1 Message Date
huangkairan
228a72e1e8 fix(web-extension): beforeunload logic (#1330) 2026-04-01 12:00:00 +08:00
Michael Dellanoce
a8dcca54d8 perf(rrweb): attribute mutation optimization (#1343) 2026-04-01 12:00:00 +08:00
Francesco Novy
6dafa924d2 ref: Avoid unnecessary cloning of objects or arrays (#1340) 2026-04-01 12:00:00 +08:00
蟹老板
532fc89a61 Pref: export eventWithTime (#1324)
*  export eventWithTime for consumption in typescript code
2026-04-01 12:00:00 +08:00
huangkairan
f57028fa28 🐞 fix(web-extension): typo (#1307)
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Francesco Novy
cd577d4d1d fix: Fix checking for patchTarget in initAdoptedStyleSheetObserver (#1327) 2026-04-01 12:00:00 +08:00
Ben White
db334d2405 Extended text masking function to include relevant HTMLElement (#1310)
* Extends maskTextFn to pass the HTMLElement to the deciding function

---------

Authored-by: benjackwhite <benjackwhite@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
Eoghan Murray
5e47fac5d0 Add config option to turn off all snapshotting and related observers (#1311)
* Add config option to turn off all snapshotting and related observers

 - allows RRWEB to be used for click/movement tracking alone, e.g. for a heatmaps use case
 - could also be used if there was a separate process for recording the DOM (in which case a 3rd party library like https://github.com/antonmedv/finder could be added to record targets instead of the mirror)
---------

Authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
705a03a84e Perf: Avoid creation of intermediary array when iterating over style rules (#1272)
* Perf: Avoid creation of intermediary array when iterating over stylesheet rules by using the second `mapFn` argument of Array.from

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from

Performance analysis by: JonasBA <jonas@badalic.com>
Authored-by: Eoghan Murray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
Justin Halsall
515274f22b Make sure CI doesn't trigger updates to yarn.lock files (#1288)
* Make sure CI doesn't trigger updates to yarn.lock files

* Apply formatting changes

* Create cuddly-readers-warn.md

* Apply formatting changes
2026-04-01 12:00:00 +08:00
github-actions[bot]
8f03b3ae2a Version Packages (alpha) (#1286)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
a6812827e0 Add workaround for Chrome/Edge css import escaping bug (#1287)
* Upgrade to typescript 4.9.5

* Apply formatting changes

* Add workaround for chrome incorrect escaping bug

More info: https://bugs.chromium.org/p/chromium/issues/detail?id=1472259

* Apply formatting changes

* Create itchy-dryers-double.md

* Create rich-jars-remember.md

* Apply formatting changes

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

* Apply formatting changes

* Update packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap

* Apply formatting changes

* Update snapshot

* Apply formatting changes

* Rename and refactor fixBrowserCompatibilityIssuesInCSSImports, getCssRulesString and getCssRuleString based on @eoghanmurray feedback

* Apply formatting changes

* Apply formatting changes
2026-04-01 12:00:00 +08:00
Eoghan Murray
6de70cbf21 Extend to run fixBrowserCompatibilityIssuesInCSS over inline stylesheets (#1279)
* Extend to run fixBrowserCompatibilityIssuesInCSS over styles in inline style sheets

* Apply formatting changes

---------

Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
26084f9bf7 doc: update sponsor list and company list (#1282)
* doc: update sponsor list and company list

* Apply formatting changes

* Apply formatting changes

* Create khaki-dots-bathe.md

* Apply formatting changes

* Apply formatting changes

---------

Co-authored-by: YunFeng0817 <YunFeng0817@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
github-actions[bot]
d5057c6268 Version Packages (alpha) (#1252)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
7d1a278688 Canvas recording: Preserve drawing buffer (#1273)
* Upgrade jest to 29 and puppeteer to 16 in rrweb

* Apply formatting changes

* Upgrade rrweb's puppeteer to v20

* Apply formatting changes

* Canvas: Reduce flickering and capturing of empty canvas elements

Turn on `preserveDrawingBuffer` by default for canvas FPS recording.
Has some negative performance implications, but really helps when capturing canvas.

* Apply formatting changes

* Include all test image snapshots in ci

* Apply formatting changes

* Allow more flexibility when capturing hover

* Apply formatting changes

* Create tiny-chairs-build.md

* Apply formatting changes

* Update hover.test.ts

* Apply formatting changes

* Document snapshotFormat jest config

* Freeze `yarn.lock` in ci for reproducible dependencies

* Apply formatting changes

* Apply formatting changes

* Revert to old style of puppeteer evaluation script notation

* Apply formatting changes

* Make test less flaky

* Apply formatting changes

* Apply formatting changes

* Make tests less flaky

* Apply formatting changes

* Make test more robust

* Apply formatting changes

* Apply formatting changes

* Add debugging code for test

* Apply formatting changes

* Also test not ignored input

* Apply formatting changes

* Apply formatting changes

* Apply formatting changes

* escape ignoreSelector

* Apply formatting changes

* Apply formatting changes
2026-04-01 12:00:00 +08:00
Billy Vong
d4ce14af98 feat: Add ignoreSelector option (#1262)
* feat: Add `ignoreSelector` option

Similar to `ignoreClass`, but accepts a CSS selector so that you can use any CSS selector.

* Apply formatting changes

* Create clean-shrimps-lay.md

* Apply formatting changes
2026-04-01 12:00:00 +08:00
Eoghan Murray
b4288791bd Mutation (attribute & text) duplicate info elimination (#1269)
* Add a test which demonstrates how no mutations are generated when an element is created & destroyed in the same 'cycle' (a cylce here being enforced by freezePage)

* Test demonstrating current behaviour I'm about to modify; the data-test="x" attribute is present twice in the mutation, as is the textContent value of 'y'

* Attribute or text modifications on just-added nodes are redundant as demonstrated in test case

* Some correct test changes from other tests; I've manually inspected each of these mutation removals and confirmed that the attribute values are already present in the newly added nodes elsewhere in the same mutation

* Improve reliability of test case as per Justin's advice
2026-04-01 12:00:00 +08:00
Eoghan Murray
d778e87891 Compact style mutation fixes and improvements (#1268)
* Don't use the CSSOM when there's `var()` present as it fails badly https://github.com/rrweb-io/rrweb/pull/1246

* As the CSS Object Model expands out shorthand properties, do a check on the string length before choosing which format to go for

 - this approach allows 'var()' in a styleOMValue as it's only a problem when combined with a shorthand property
 - before this change background:black; was getting expaned to 10 OM properties as follows:

'style': {
    'background-color': 'black',
    'background-image': false,
    'background-position-x': false,
    'background-position-y': false,
    'background-size': false,
    'background-repeat-x': false,
    'background-repeat-y': false,
    'background-attachment': false,
    'background-origin': false,
    'background-clip': false
}

* Updates to remainder of tests based on refined compact style mutations

* Apply suggestions from code review by: Justin Halsall <Juice10@users.noreply.github.com>

---------

Authored-by: eoghanmurray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
Francesco Novy
3cf1b8b450 fix: Fix CSS rules captured in Safari (#1253)
* fix: Fix CSS rules captured in Safari

* Apply formatting changes

* add changeset

* fix

---------

Co-authored-by: mydea <mydea@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Francesco Novy
5c3e1cf1e7 fix: Handle case where event is null/undefined (#1254)
* fix: Handle case where `event` is null/undefined

* add changeset
2026-04-01 12:00:00 +08:00
fukang wang
64328b8a0e fix: Resize and MediaInteraction events repeat generated after the iframe appeared (#1251)
* fix: Resize and MediaInteraction events repeat generated after the iframe appeared

* Create nervous-buses-pump.md

* Apply formatting changes

---------

Co-authored-by: wangfukang <wangfukang@kuaishou.com>
Co-authored-by: wfk007 <wfk007@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
github-actions[bot]
7d91a1ad0c Version Packages (alpha) (#1216)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
2e03e4da2a Fix types in rrwebPlayer (#1247)
* Export correct mirror in player

Was using DeprecatedMirror in its types, that shouldn't be used anymore.

* Add playRange to types

* Create smooth-poems-bake.md

* Apply formatting changes

* Add $set to player type

* Update smooth-poems-bake.md

* Apply formatting changes

* Last two arguments of playRange are optional
2026-04-01 12:00:00 +08:00
Eoghan Murray
f29a30bfb7 Guard against redefinition of Date.now (#1196)
* Guard against presence of likely older third party libraries which (re)define Date.now, e.g. https://github.com/datejs/Datejs/issues/92

* Apply formatting changes

* (remove nowTimestamp import where Date.now() is not used)

* Add a PURE marker so an empty `ìf` statement doesn't show up in the rrweb-replay output

* Update packages/rrweb/src/utils.ts

Fix typing issue with regex against `Date.now()`

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

* Create little-radios-thank.md

* Apply formatting changes

* Update .changeset/little-radios-thank.md

* Apply formatting changes

---------

Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
e042576127 Update test commands (#1205)
* As per @Yun Feng: everyone has npm installed globally but maybe not yarn

* Add command to enable test result updating

* Default to running tests HEADLESS on rrweb

* Add command to build:all in a low memory environment

* Add a 'retest' command for when the code hasn't changed, but you are working on the test cases

* Add commands to reformat according to prettier. Named 'reformat' to indicate that we are doing a `--write`

* Update package.json

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>

* Apply suggestions from code review

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>

* Create few-turkeys-reflect.md

* Apply formatting changes

---------

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
Francesco Novy
ff54a2b097 fix: Ensure attributes are lowercased when checking (#1183)
* fix: Ensure attributes are lowercased when checking

* add changeset

* fix to lower case

* Apply formatting changes

---------

Co-authored-by: mydea <mydea@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
a539fd8f5b Fix rrdom bugs (#1222)
* fix: rrdom bug

1. fix one bug of the diff algorithm
2. omit srcdoc attribute of iframe

* use linked list to iterate children

* fix the bug that the children of shadowRoot don't get diffed

* add test cases

* add change log
2026-04-01 12:00:00 +08:00
Yun Feng
2294fc262e fix turbo dev command errors (#1229)
* fix turbo dev command errors

* Create forty-elephants-attack.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
fukang wang
d8ef6159e2 perf: optimize performance of the DoubleLinkedList get (#1220)
* perf: optimize performance of the DoubleLinkedList get

* fix: delete addedNodeIndexArr
2026-04-01 12:00:00 +08:00
Justin Halsall
d882347a08 Docs: scale sponsors by donation size (#1217)
* Scale sponsors

Gold sponsors where a bit too big. I've scaled down all sponsors to match their donation level (calculation below). Also makes the low res image of our gold sponsor less apparent.

Example:

Bronze Sponsors Calculation:
50 pixels per donation $
100$ = 5000 pixels
√5000 = +/-70
Resolution: 70*70 = +/-5000 pixels

* Create fresh-cars-impress.md
2026-04-01 12:00:00 +08:00
Yun Feng
937e3b42ce rrvideo: improve the video quality and add a progress bar for the CLI tool (#1197)
* refactor rrvideo: use playwright rather than puppeteer

* add a progress bar for the tool

* add tests for cli.ts

* fix build error

* add change log

* update readme file

* Apply a scaling method to improve the resolution of the output video
2026-04-01 12:00:00 +08:00
fukang wang
6a4a816538 perf: record processMutation (#1214)
* perf: record processMutation

* Create mean-tips-impress.md

* Apply formatting changes
2026-04-01 12:00:00 +08:00
Justin Halsall
19727cf50e Add highlight to "who's using rrweb" (#1215)
* Add highlight to "who's using rrweb"

* Create rich-crews-protect.md
2026-04-01 12:00:00 +08:00
Yun Feng
354959cd0c fix: all tiers of sponsors are displayed under the 'gold sponsor' level (#1210) 2026-04-01 12:00:00 +08:00
github-actions[bot]
dddf1de4da Version Packages (alpha) (#1199) 2026-04-01 12:00:00 +08:00
Eoghan Murray
aa4c7f9820 Reduce verbosity/redundancy of new pointerType attribute (#1206)
* Reduce verbosity/redundancy of output of new pointerType attribute by confining it only to clicks (and to a MouseDown/MouseUp from a PointerTypes.Pen, as these don't yet have a dedicated PendDown/PenUp)

* Update how the changeset will read for the next release based on the trimming in this PR

* Prefer triple equals

* The assignment to the outer `pointerType` variable in an anonymous function was somehow missed by the `typings` check

* Apply formatting changes

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

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

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Ben White
ec5e536891 feat: Added support maskInputFn with HTMLElement (#1188) 2026-04-01 12:00:00 +08:00
Justin Halsall
23388f2d00 Add gold sponsors (#1207)
* Add gold sponsors

* Create empty-bikes-cheer.md
2026-04-01 12:00:00 +08:00
Eoghan Murray
87b95bfc14 Merge pull request #1201 from eoghanmurray/pointerTypeFixups
Pointer type fixups
2026-04-01 12:00:00 +08:00
Eoghan Murray
f83168ddba Merge pull request #1129 from eoghanmurray/pointerType
Record pointerType on clicks
2026-04-01 12:00:00 +08:00
Justin Halsall
94d0838202 Create fair-dragons-greet.md 2026-04-01 12:00:00 +08:00
Charlie Gracie
781ca8de91 fix: Set finished=false in goto instead of handleProgressClick (#1198)
* Reset the finished flag in goto

If the player finishes a replaying a video the `finished` boolean is set to true. This allows the video to be restarted at the beginning if the controller is toggled again. If a user clicks on the progress bar the `finished` boolean is reset so if the `toggle` API is called it starts at the right place. If a user programatically calls `goto` which is the underlying API that handling the progress click calls the next invocation of `toggle` will start the video at the beginning instead of the proper location.

* Create controller-finish-flag.md

* Update controller-finish-flag.md
2026-04-01 12:00:00 +08:00
Francesco Novy
6360042d33 fix: Fix input.type check (#1184)
* fix: Fix input.type check

Actually I noticed that `el.type` returns `text` when type is not explicitly set, so this is slightly incorrect.

* fix linting

* Apply formatting changes
2026-04-01 12:00:00 +08:00
Yun Feng
ea9033fc08 improve: add try catch to snapshot.ts 's masking text function (#1148)
* improve: add try catch to snapshot.ts to make it robust

* add change log
2026-04-01 12:00:00 +08:00
eoghanmurray
78127d72ab Apply formatting changes 2026-04-01 12:00:00 +08:00
Eoghan Murray
e3bb1666d4 Create little-suits-leave.md 2026-04-01 12:00:00 +08:00
github-actions[bot]
fbdf82729c Version Packages (alpha) (#1175)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Yun Feng
78935ea820 move rrvideo to monorepo (#1181)
* first commit

* rrvideo v0.1.0

First version of rrvideo.

1. Use as a Node.JS lib.
2. Use as a CLI.

Features are implemented via puppeteer, ffmpeg and rrweb-player.

* add readme

* update publish script

* add node env in cli file and change package.json bin to same like README (#4)

Co-authored-by: Xu Yinjie <xuyinjie@xiaobangtouzi.com>

* release 0.2.0

* fix #6 avoid assign undefined to config

* Fix: Solve the inconsistency between rrvideo and the real recorded page rendering when rendering the page with a headless browser (https://github.com/rrweb-io/rrvideo/pull/26)

Author: xujiujiu <906784584@qq.com>

---------

Co-authored-by: xujiujiu <906784584@qq.com>

* refactor rrvideo

1. refactor code
2. change monorepo config
3. remove separate TS dependencies

* add changeset

* fix: eslint errors

---------

Co-authored-by: Yanzhen Yu <yanzhen@smartx.com>
Co-authored-by: xyj <593500664@qq.com>
Co-authored-by: Xu Yinjie <xuyinjie@xiaobangtouzi.com>
Co-authored-by: xujiujiu <906784584@qq.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
031a72721c Fix: Trigger mouse movement & hover with mouse up/down in sync mode (#1191)
* Trigger mouse movement & hover with mouse up/down in sync mode

* Trigger touchActive and mouseDown on flush
2026-04-01 12:00:00 +08:00