Commit Graph

1225 Commits

Author SHA1 Message Date
github-actions[bot]
083da07212 Version Packages (alpha) (#1453)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
1fd5c2bc00 Fix and test for bug #1457 (#1481)
* Fix and test for bug #1457 (Uncaught SyntaxError: Regular expression too large)

 - see test case which is extracted from a real world css file; the selector regex was able to traverse the curly brace as when looking for quotes, it wasn't taking into account that the start quote could be escaped

* Apply formatting changes

* Create fair-ducks-clean.md

* Fix @import regex bit which was stopping consumption in the middle of a url - need to consume quotes.

Thanks dave.kindel@pendo.io for reporting and isolating this case

---------

Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Colin Maxfield
711a7cbbaa Replace Array.from with clean implementation (#1464)
This work is to try to provide support where rrweb might be included
in applications with various tools that might override Array.from
so that the 2nd parameter (the map function) will always work for
rrweb.

Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io>
2026-04-01 12:00:00 +08:00
Eoghan Murray
12fcc76e69 Fixup for background-clip replacement (#1476)
* Fix that the `.replace()` function only replaces the first occurrence

* This should have been included in #1174

* Create fast-pets-exist.md
2026-04-01 12:00:00 +08:00
Eoghan Murray
9919a943a6 yarn format - prettier improvements & add .editorconfig (#1471)
Some dev improvements:
* Add .editorconfig config file https://editorconfig.org/
* move the singleQuote spec into .editorconfig and add old .changesets/*.md to .prettierignore so that we don't incorrectly reformat new changeset files to single quote from the double quote which they can be autogenerated with in github
* .gitignore Ignore emacs chaff files
* Add `yarn format:head` a convenience command to run prettier against just those files in the head commit
* Some mention of `yarn format` in the docs
* Fix some test html closing tags; authoring mistakes, rather than deliberately malformed html — picked up by an explicit `yarn prettier --write '**/*.html'`
2026-04-01 12:00:00 +08:00
Eoghan Murray
8f1a8c962f Fix that blob urls persist on the shared anchor element and can't be later modified (#1467)
* Fix that blob urls persist on the shared anchor element and can't be later modified

* Create nervous-kiwis-nail.md
2026-04-01 12:00:00 +08:00
Vinicius Lourenço
13333fe19e perf(snapshot): avoid recreate element a every time (#1387)
perf(snapshot): avoid costly generation of <a> element on each call to `getHref`, instead cache an anchor element and reuse it's href attributed

---------

Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
Eoghan Murray
82da69c0d2 Ensure there is separation of timestamps (#1455)
* Ensure there is separation of timestamps so mutations can be evaluated separately - was failing in the github build process probably due to higher perf

* Remove space from test file

* Create curvy-balloons-brake.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
049274dd37 perf: Avoid an extra function call and object clone during event emission (#1441)
performance: remove a nested function call and an object clone during event emission

 - rename `event` to `eventWithoutTime`, but maintain backwards compatibility
 - `eventWithTime` (with time) could be renamed to `event` in a future version

This is an extension of PR #1339 authored by: mydea <mydea@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
David Newell
28f32140f0 better splitting of selectors (#1440)
* better splitting of selectors - overlapping with #1401 
* Add test from example at https://github.com/PostHog/posthog/pull/21427
* ignore brackets inside selector strings
* Add another test as noticed that it's possible to escape strings
* Ensure we are ignoring commas within strings

Co-authored-by: Eoghan Murray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
github-actions[bot]
a736f72e0f Version Packages (alpha) (#1436)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Stefan Sundin
e117803eae Add "types" field to fix error when using "moduleResolution": "NodeNext" (#1369)
* Add "types" field to fix error when using "moduleResolution": "NodeNext".

* Add changeset.
2026-04-01 12:00:00 +08:00
Daniel Engelke
7e586f4c90 Fix for test cases mentioned in #1379 (#1401)
* Fix known issues

* Run format

* Fix linting errors

* Add comment in code for source of match logic

* Add changeset
2026-04-01 12:00:00 +08:00
Justin Halsall
f6543be763 Full overhawl of video & audio playback to make it more complete (#1432)
* Add support for capturing media attributes in rrweb-snapshot

* Add loop to mediaInteractionParam

* Add support for loop in RRMediaElement

* Add support for recording loop attribute on media elements

* Update video playback and fix bugs

* Update cross-origin iframe media attributes and player state
2026-04-01 12:00:00 +08:00
Eoghan Murray
c61c906e31 I forgot to pay attention to yarn format during merge of #1408 (#1452) 2026-04-01 12:00:00 +08:00
Antonio Villegas
2ac93b18c7 Expose constant SKIP_TIME_THRESHOLD as inactivePeriodThreshold in replayer (#1408)
Expose constant SKIP_TIME_THRESHOLD as `inactivePeriodThreshold` config setting in replayer
2026-04-01 12:00:00 +08:00
David Newell
5956f9b4aa protect against no parent node (#1445)
* protect against a missing parent node during a mutation on an textNode
2026-04-01 12:00:00 +08:00
Manoel Aranda Neto
8a93739766 fix: createImageBitmap throws DOMException if source is 0 (#1422)
* fix: createImageBitmap throws DOMException if source is 0

* code review

* fix

* Create breezy-cats-heal.md

* fix format

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
169e10e94a Chore: Make inject script more robust on repl & stream (#1429)
* try/catch injection of recording script in rrweb repl and stream

* Add empty changesets
2026-04-01 12:00:00 +08:00
github-actions[bot]
fb2d921180 Version Packages (alpha) (#1291)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Daniel Engelke
763ac64130 Add HowdyGo to Who's using rrweb (#1423)
* Add HowdyGo to Who's using rrweb

* Create twenty-goats-kneel.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
585c5c7ac3 Fix some css issues with :hover and rewrite max-device-width (#1431)
* We weren't recursing into media queries (or @supports etc.) to rewrite hover pseudoclasses

* The early return meant that the stylesWithHoverClass cache wasn't being populated if there were no hover selectors on the stylesheet

 - not committing the test, but modifying the existing 'add a hover class to a previously processed css string' as follows shows the problem:

--- a/packages/rrweb-snapshot/test/rebuild.test.ts
+++ b/packages/rrweb-snapshot/test/rebuild.test.ts
@@ -151,6 +185,7 @@ describe('rebuild', function () {
         path.resolve(__dirname, './css/benchmark.css'),
         'utf8',
       );
+      cssText = cssText.replace(/:hover/g, '');

       const start = process.hrtime();
       addHoverClass(cssText, cache);

* Replace `min-device-width` and similar with `min-width` as the former looks out at the browser viewport whereas we need it to look at the replayer iframe viewport

* Add some tests to show how the hover replacement works against selector lists. I believe these were failing in a previous version of rrweb as I had some local patches that no longer seem to be needed to handle these cases

* Update name of function to reflect that 'addHoverClass' does more than just :hover. I believe this function is only exported for the purposes of use in the tests

* Apply formatting changes

* Create rotten-spies-enjoy.md

* Apply formatting changes

* Add correct typing on `getSelectors`

* Refactor CSS interfaces to include optional rules

* Change `rules` to be non optional

---------

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
juliecheng
3da2652950 fix: scrolling can be incorrect when fast-forwarding (#1352)
* fix: scrolling can be incorrect when fast-forwarding

* add test case

* add changeset and remove duplicate diffProps process

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
xujiujiu
3f4bf14dfb fix guide doc (#1415) 2026-04-01 12:00:00 +08:00
Andrew Pomeroy
8b90bd8f62 Capture stylesheets designated as rel="preload" (#1374)
* feat(Snapshot): Capture stylesheets designated as `rel="preload"`

* fix(Snapshot): Harden asset file extension matching

* Add changeset

* chore: Lint

* Tweak regex, add try-catch block on URL constructor
2026-04-01 12:00:00 +08:00
Antonio Villegas
8d555c1b1c Make properties x and y optional in mouseInteractionParam (#1375)
* Make properties x and y optional in mouseInteractionParam

The event representing a mouse interaction of focus an element does not include the properties x and y. Thus, they must be defined as optional.

* Fix typings
2026-04-01 12:00:00 +08:00
yz-yu
a939c792db fix the test CI (#1405)
* run tests without concurrency

* do not use cache in rpt2 during test
2026-04-01 12:00:00 +08:00
Patrick Lopes
297e4bc4c7 Rrvideo receipe update (#1390)
* Update export-to-video.md

The file was pointing to the old Rrvideo repo The old repository soon is going to be closed as the Rrvideo was merged on Rrweb This change is pointing this recipe to the new and updated official doc.

* Update export-to-video.zh_CN.md

The file was pointing to the old Rrvideo repo The old repository soon is going to be closed as the Rrvideo was merged on Rrweb This change is pointing this recipe to the new and updated official doc.

Chinese version
2026-04-01 12:00:00 +08:00
Paul D'Ambra
77e12e4f54 fix: console logger can serialize bigint values (#1403)
* fix: console logger can serialize bigint values

* teach test jsdom is present

* add a changeset
2026-04-01 12:00:00 +08:00
David Newell
6510e32456 chore: export canvasMutation (#1383)
* chore: export canvasMutation

* add changeset
2026-04-01 12:00:00 +08:00
Justin Halsall
04a5ce9ad8 Docs: Add rrweb presentation + open to consulting (#1388)
* Add rrweb presentation

Add Justin Halsall open to rrweb consulting

* Create few-rockets-travel.md

* Update README.md

* Update README.md

* Fix alignment
2026-04-01 12:00:00 +08:00
Buleandra Cristian
30fda9d726 Add UXWizz to Readme (#1371)
* Add UXWizz to Readme (CN)

* Add UXWizz to Readme

* Create hip-worms-relax.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
43bce2b6e0 [chore] [ci] Update Node version to LTS (#1365)
* Update Node version to LTS

* Create silver-windows-float.md
2026-04-01 12:00:00 +08:00
Justin Halsall
e763ada2c1 [chore] Update changesets (#1362) 2026-04-01 12:00:00 +08:00
huangkairan
2db6264887 perf(web-extension): conditional check (#1360)
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Paul D'Ambra
f91d22bf31 chore: update linters (#1355)
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
a8d93986f4 Fix serialization and mutation of <textarea> elements (#1351)
* Fix serialization and mutation of <textarea> elements taking account the duality that the value can be set in either the child node, or in the value _parameter_ (not attribute)

* Backwards compatibility: Bug fix and regression test for #112
 - this is to fix up 'historical' recordings, as duplicate textarea content should no longer be being created at record time
 - new test shows what the snapshot generated by previous versions of rrweb used to look like, hence 'bad'
 - original 0efe23f04a fix either didn't work or no longer works due to childNodes being appended subsequent to this part of the code
 - during review, we also verified that the `_cssText` case should still be handled okay, as there's currently no scenario where csstext is present with css child nodes of a <style>

* Masking: Fix that textarea values were being missed by the masking system if the value was recorded as a child node
 - I didn't notice that form.html was used in other tests, so lucky that I noticed that those tests also should have the 'pre value' masked out

* Simplify by always storing the textarea value in the `.value` attribute (from it's DOM property) and not as a childNode. It should still be rebuilt as a childNode rather than a property
---------

Authored-by: eoghanmurray <eoghan@getthere.ie>
2026-04-01 12:00:00 +08:00
Eoghan Murray
d1d0c7f366 Masking: Avoid the repeated calls to closest when recursing through the DOM (#1349)
* masking performance: avoid the repeated calls to `closest` when recursing through the DOM
 - needsMask===true means that an ancestor has tested positively for masking, and so this node and all descendents should be masked
 - needsMask===false means that no ancestors have tested positively for masking, we should check each node encountered
 - needsMask===undefined means that we don't know whether ancestors are masked or not (e.g. after a mutation) and should look up the tree
* Add tests including an explicit characterData mutation tests 
* Further performance improvement: avoid calls to `el.matches` when on a leaf node, e.g. a `<br/>`
---------

Authored-by: eoghanmurray <eoghan@getthere.ie>
Based on initial PR #1338 by Alexey Babik <alexey.babik@noibu.com>
2026-04-01 12:00:00 +08:00
Yun Feng
4157f28e7b Feat: Add support for replaying :defined pseudo-class of custom elements (#1155)
* Feat: Add support for replaying :defined pseudo-class of custom elements

* add isCustom flag to serialized elements

Applying Justin's review suggestion

* fix code lint error

* add custom element event

* fix: tests (#1348)

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

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

---------

Co-authored-by: Nafees Nehar <nafees87n@gmail.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Eoghan Murray
1647bc3875 Md create html document (#1321)
* only call createHTMLDocument where it is needed

* Perf: create the mutation document once as a 'singleton' as it can be reused

---------

Co-authored-by: Michael Dellanoce <mdellanoce@pendo.io>
2026-04-01 12:00:00 +08:00
Billy Vong
2de4c0d326 fix(web-extension): Fix types in vite config (#1333) 2026-04-01 12:00:00 +08:00
Lukas Boehler
910fa46d78 Added Gleap.io to "Who's using rrweb?" (#1332)
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
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
Justin Halsall
637264c225 Fix linting issues (#1347)
* Fix linting issues

* Apply formatting changes
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