Commit Graph

1212 Commits

Author SHA1 Message Date
Justin Halsall
123a81e12d 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
2024-04-17 15:49:23 +02:00
Eoghan Murray
eba5473770 I forgot to pay attention to yarn format during merge of #1408 (#1452) 2024-04-17 14:20:20 +01:00
Antonio Villegas
729361e66b Expose constant SKIP_TIME_THRESHOLD as inactivePeriodThreshold in replayer (#1408)
Expose constant SKIP_TIME_THRESHOLD as `inactivePeriodThreshold` config setting in replayer
2024-04-11 11:20:24 +01:00
David Newell
02f50d260c protect against no parent node (#1445)
* protect against a missing parent node during a mutation on an textNode
2024-04-10 16:46:06 +01:00
Manoel Aranda Neto
3d1877cff8 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>
2024-04-05 14:24:25 +02:00
Justin Halsall
e223399c7c Chore: Make inject script more robust on repl & stream (#1429)
* try/catch injection of recording script in rrweb repl and stream

* Add empty changesets
2024-04-05 12:15:14 +02:00
github-actions[bot]
104900263a Version Packages (alpha) (#1291)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-04 16:29:26 +02:00
Daniel Engelke
5e6a0be3a1 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>
2024-03-26 17:11:04 +01:00
Eoghan Murray
a7c33f2093 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>
2024-03-26 16:44:43 +01:00
juliecheng
e607e83b21 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>
2024-02-28 03:29:05 +08:00
xujiujiu
cc6c6874ca fix guide doc (#1415) 2024-02-23 18:21:49 +08:00
Andrew Pomeroy
314a8dde5a 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
2024-02-12 18:19:17 +01:00
Antonio Villegas
5844f60fd8 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
2024-02-10 09:12:56 +08:00
yz-yu
fc2feee60a fix the test CI (#1405)
* run tests without concurrency

* do not use cache in rpt2 during test
2024-01-28 14:13:14 +08:00
Patrick Lopes
ce8da12d56 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
2024-01-26 17:44:08 +08:00
Paul D'Ambra
af0962cc6c fix: console logger can serialize bigint values (#1403)
* fix: console logger can serialize bigint values

* teach test jsdom is present

* add a changeset
2024-01-25 16:55:52 +01:00
David Newell
1e0b273822 chore: export canvasMutation (#1383)
* chore: export canvasMutation

* add changeset
2024-01-22 16:32:32 +01:00
Justin Halsall
b2460a4991 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
2024-01-05 12:20:10 +01:00
Buleandra Cristian
8aaca89234 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>
2023-12-11 14:09:18 +01:00
Justin Halsall
8e318c44f2 [chore] [ci] Update Node version to LTS (#1365)
* Update Node version to LTS

* Create silver-windows-float.md
2023-12-04 17:38:28 +01:00
Justin Halsall
dc52b38cad [chore] Update changesets (#1362) 2023-12-04 14:11:00 +01:00
huangkairan
0f004af18d perf(web-extension): conditional check (#1360)
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-12-04 21:45:53 +11:00
Paul D'Ambra
59208ad0f5 chore: update linters (#1355)
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2023-12-04 16:40:05 +11:00
Eoghan Murray
a2be77b828 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>
2023-12-01 13:18:58 +00:00
Eoghan Murray
07ac5c9e13 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>
2023-11-24 16:06:02 +00:00
Yun Feng
8aea5b00a4 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>
2023-11-07 15:26:13 +01:00
Eoghan Murray
dbd15a9492 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>
2023-11-06 11:10:07 +01:00
Billy Vong
40f484d088 fix(web-extension): Fix types in vite config (#1333) 2023-11-04 09:23:49 +11:00
Lukas Boehler
5add06fd93 Added Gleap.io to "Who's using rrweb?" (#1332)
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2023-11-04 09:17:10 +11:00
huangkairan
9e65dda258 fix(web-extension): beforeunload logic (#1330) 2023-11-04 09:10:00 +11:00
Michael Dellanoce
05478c36dd perf(rrweb): attribute mutation optimization (#1343) 2023-11-04 09:03:59 +11:00
Francesco Novy
9c6edfe226 ref: Avoid unnecessary cloning of objects or arrays (#1340) 2023-11-03 12:09:21 +01:00
Justin Halsall
f362e7a84c Fix linting issues (#1347)
* Fix linting issues

* Apply formatting changes
2023-11-03 11:40:54 +01:00
蟹老板
1fe39ab0db Pref: export eventWithTime (#1324)
*  export eventWithTime for consumption in typescript code
2023-10-31 17:20:25 +00:00
huangkairan
8444cb2dad 🐞 fix(web-extension): typo (#1307)
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-10-20 14:10:21 +11:00
Francesco Novy
57a940afac fix: Fix checking for patchTarget in initAdoptedStyleSheetObserver (#1327) 2023-10-13 22:05:26 +11:00
Ben White
7c0dc9dfe1 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>
2023-10-13 12:02:08 +01:00
Eoghan Murray
980a38c816 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>
2023-10-13 09:58:20 +01:00
Kento Moriwaki
297104cc8a Enable preserveSource (#1309) 2023-10-06 10:42:59 +01:00
Eoghan Murray
58c9104edd 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>
2023-08-15 10:39:29 +01:00
Eoghan Murray
64420c7e46 Perf: don't run the regex replace unless the selectorText contains a colon (#1280)
* Perf: don't run the regex replace unless the selectorText contains a colon (rules generally contain colons)

* Need to check type before querying selectorText property - also good as it means we only try to fix colons at the leaf level
---------

Authored-by: eoghan murray <eoghan@getthere.ie>
2023-08-14 12:43:34 +01:00
Justin Halsall
f1b8e855b1 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
2023-08-14 11:33:24 +02:00
github-actions[bot]
3119e0d1d8 Version Packages (alpha) (#1286)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-14 11:05:02 +02:00
Justin Halsall
efdc167ca6 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
2023-08-11 17:58:42 +02:00
Eoghan Murray
11f6567fd8 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>
2023-08-11 15:19:33 +02:00
Yun Feng
b01297373b 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>
2023-08-10 10:37:20 +02:00
Sahil Gupta
5f179705d5 Added requestly in who's using rrweb section (#1278) 2023-08-08 21:48:55 +08:00
github-actions[bot]
8a48e42378 Version Packages (alpha) (#1252)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-07 10:21:52 +02:00
Justin Halsall
a3de582e9c 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
2023-08-04 18:35:49 +02:00
Billy Vong
36da39db36 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
2023-08-04 10:30:03 +02:00