Commit Graph

41 Commits

Author SHA1 Message Date
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
Francesco Novy
74411fc544 feat: Allow to pass errorHandler as record option (#1107)
* feat: Allow to pass `errorHandler` as record option

* add docs

* Apply formatting changes
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
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
Justin Halsall
81ed51c1e0 Make maximum scale configurable (#1006) 2026-04-01 12:00:00 +08:00
何遇
268229b8b3 feat: add dataURLOptions parameter control canvas image format and quality (#967)
* feat: record add dataURLOptions parameter control canvas image format and quality

* 解决 build failed

* Update docs/recipes/canvas.md

* Apply formatting changes

* Update canvas-manager.ts

Fix the error caused when I resolved the merge conflict

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng@anu.edu.au>
Co-authored-by: Mark-Fenng <Mark-Fenng@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2026-04-01 12:00:00 +08:00
Yun Feng
f878cc032d CI: add a prettier GitHub action to format code automatically (#988)
* CI: add a prettier GitHub action to format code automatically

* improve GitHub Action config and format some files

* Apply formatting changes

* CI: make the prettier action a standalone action

* Apply formatting changes

* CI: add push as new trigger event

Co-authored-by: Mark-Fenng <Mark-Fenng@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
dbseel
c94b5783c4 isBlocked factors in the selector (#894)
* isBlocked factors in the selector

* Ensure contains parameter is a node

* Fix blockSelector blocking for closest nodes

* Fix integration test

* adding ignoreCSSAttributes to ignore the addition of certain css attributes

* tested ignoreCSSAttributes

* Update test snapshot

* swapped the wrapping of htmlelement to be element

* Fix linter errors

* Address MR feedback

* Rebase

Co-authored-by: Filip <filipslatinac@gmail.com>
2026-04-01 12:00:00 +08:00
Yun Feng
132ed2ade0 feat: add a destroy function to destroy the whole player (#953)
* feat: add a destroy function to destroy the whole player

* doc: update guidance document

* Update packages/rrweb/src/replay/index.ts

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

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2026-04-01 12:00:00 +08:00
Justin Halsall
2887c8c7e5 #853 Second try: fast-forward implementation v2: virtual dom optimization (#895)
* rrdom: add a diff function for properties

* implement diffChildren function and unit tests

* finish basic functions of diff algorithm

* fix several bugs in the diff algorithm

* replace the virtual parent optimization in applyMutation()

* fix: moveAndHover after the diff algorithm is executed

* replace virtual style map with rrdom

cssom version has to be above 0.5.0 to pass virtual style tests

* fix: failed virtual style tests in replayer.test.ts

* fix: failed polyfill tests caused by nodejs compatibility of different versions

* fix: svg viewBox attribute doesn't work

Cause the attribute viewBox is case sensitive, set value for viewbox doesn't work

* feat: replace treeIndex optimization with rrdom

* fix bug of diffProps and disable smooth scrolling animation in fast-forward mode

* feat: add iframe support

* fix: @rollup/plugin-typescript build errors in rrweb-player

Error: @rollup/plugin-typescript TS1371: This import is never used as a value and must use 'import type' because the 'importsNotUsedAsValues' is set to 'error'

* fix: bug when fast-forward input events and add test for it

* add test for fast-forward scroll events

* fix: custom style rules don't get inserted into some iframe elements

* code style tweak

* fix: enable to diff iframe elements

* fix  the jest error "Unexpected token 'export'"

* try to fix build error of rrweb-player

* correct the attributes definition in rrdom

* fix: custom style rules are not inserted in some iframes

* add support for shadow dom

* add support for MediaInteraction

* add canvas support

* fix unit test error in rrdom

* add support for Text, Comment

* try to refactor RRDom

* refactor RRDom to reduce duplicate code

* rename document-browser to virtual-dom

* increase the test coverage for document.ts and add ownerDocument for it

* Merge branch 'master' into virtual-dom

* add more test for virtual-dom.ts

* use cssstyle in document-nodejs

* fix: bundle error

* improve document-nodejs

* enable to diff scroll positions of an element

* rename rrdom to virtualDom for more readability and make the tree public

* revert unknown change

* improve the css style parser for comments

* improve code style

* update typings

* add handling for the case where legacy_missingNodeRetryMap is not empty

* only import types from rrweb into rrdom

* Apply suggestions from code review

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

* Apply suggestions from code review

* fix building error in rrweb

* add a method setDefaultSN to set a default value for a RRNode's __sn

* fix rrweb test error and bump up other packages

* add support for custom property of css styles

* add a switch for virtual-dom optimization

* Apply suggestions from code review

1. add an enum type for NodeType
2. rename nodeType from rrweb-snapshot to RRNodeType
3. rename notSerializedId to unserializedId
4. add comments for some confusing variables

* adapt changes of #865 to virtual-dom and improve the test case for more coverage

* apply review suggestions

https://github.com/rrweb-io/rrweb/pull/853#pullrequestreview-922474953

* tweak the diff algorithm

* add description of the flag useVirtualDom and remove outdated logConfig

* Remove console.log

* Contain changes to document

* Upgrade rollup to 2.70.2

* Revert "Upgrade rollup to 2.70.2"

This reverts commit b1be81a2a76565935c9dc391f31beb7f64d25956.

* Fix type checking rrdom

* Fix typing error while bundling

* Fix tslib error on build

Rollup would output the following error:
`semantic error TS2343: This syntax requires an imported helper named '__spreadArray' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'.`

* Increase memory limit for rollup

* Use esbuild for bundling

Speeds up bundling significantly

* Avoid circular dependencies and import un-bundled rrdom

* Fix imports

* Revert back to pre-esbuild

This reverts the following commits:
b7b3c8dbaa551a0129da1477136b1baaad28e6e1
72e23b8e27f9030d911358d3a17fe5ad1b3b5d4f
85d600a20c56cfa764cf1f858932ba14e67b1d23
61e1a5d323212ca8fbe0569e0b3062ddd53fc612

* Set node to lts (12 is no longer supported)

* Speed up bundling and use less memory

This fixes the out of memory errors happening while bundling

* remove __sn from rrdom

* fix typo

* test: add a test case for StyleSheet mutation exceptions while fast-forwarding

* rename Array.prototype.slice.call() to Array.from()

* improve test cases

* fix: PR #887 in 'virtual-dom' branch

* apply justin's suggestion on 'Array.from' refactor

related commit 0f6729d27a323260b36fbe79485a86715c0bc98a

* improve import code structure

Co-authored-by: Yun Feng <yun.feng@anu.edu.au>
2026-04-01 12:00:00 +08:00
Justin Halsall
a5ff2fc77f Record canvas snapshots N times per second (#859)
* Only record canvas when recordCanvas is true

* All should be compiled first

Makes recompiling+debugging a lot faster

* Add support for compiling web workes

Replaces @rollup/plugin-typescript for rollup-plugin-typescript2 as the former is incompatible with rollup-plugin-web-worker-loader

* Update yarn.lock

* Upgrade to typescript 4.5.5

* add support for replay of ImageBitmap in 2d canvas

* Snapshot canvases in a web-worker on FPS basis

* Fix performance of canvas recording and playback

* Wait for all images to be preloaded before checking results

* flatten base64 strings, as encoding isn't consistent

* Cleanup

* Add serializing to 2d canvases as well

* Disable blob serialize test

We don't have any code for it yet

* Upgrade @rollup/plugin-commonjs to 21.0.2

Fixes
https://linguinecode.com/post/import-export-appear-at-the-top-level

* Move canvas recording options to `sampling`

Based on: https://github.com/rrweb-io/rrweb/pull/859#discussion_r846582146
2026-04-01 12:00:00 +08:00
Constance Caramanolis
d0eed62b18 Update doc to use yarn to use REPL (#838) 2026-04-01 12:00:00 +08:00
Yanzhen Yu
80479d9b9e update plugin docs 2026-04-01 12:00:00 +08:00
Cristi Constantin
151debad4a Save images offline, in the snapshot (#770)
* Implemented image restore from rr_dataURL

* Implement saving images in the snapshot

* Fixed image saving, added a test

* Rename data-src to data-rrweb-src

* Updated the guide

* Rename recordImages to inlineImages and try catch
2026-04-01 12:00:00 +08:00
Eoghan Murray
eb25068b54 Reference packages directly in docs (removing direct references to the old rrweb-snapshot and rrweb-player repositories) (#647) 2026-04-01 12:00:00 +08:00
Justin Halsall
9df2aa8e0e Add userTriggered (#495)
* add `userTriggered`

* update snapshots to add userTriggered

* add `userTriggered`

* update snapshots to add userTriggered

* update snapshot to include userTrigger

* only set userTriggered on `userTriggeredOnInput: true`

* What is user triggered?

* correct snapshot

* add second radio to demonstrate userTriggered
2026-04-01 12:00:00 +08:00
Yanzhen Yu
35a5a4ff34 improve https://github.com/rrweb-io/rrweb-player/issues/12 2026-04-01 12:00:00 +08:00
Justin Halsall
669446b480 Docs: update link to list of input values (#604)
* Update url to list of types

* Docs: Update list of inputs (zh_CN)
2026-04-01 12:00:00 +08:00
Yun Feng
2e0d981190 doc: update guide.zh_CN.md 2026-04-01 12:00:00 +08:00
Justin Halsall
a4426d2927 Add ability to mask passwords (#494)
* add ability to mask passwords

* remove duplicate mask snapshot

* make sure only one click happens at a time
2026-04-01 12:00:00 +08:00
re-fort
b1b25447ff Add options to mask texts (#540)
* feat: add options to mask texts

* feat: add the default mask function

* refactor: rename options to identify the difference between  mask text and mask input

* test: add tests about masking

* doc: add options about masking

* chore: bump up rrweb-snapshot version
2026-04-01 12:00:00 +08:00
Justin Halsall
83045059f9 Fix docs to point to correct event format (#523)
* Fix docs to point to correct event attribute

* Update customize-replayer.zh_CN.md

* correct event object in guide

* Update guide.zh_CN.md
2026-04-01 12:00:00 +08:00
Season
4e9e64cc5c update guide 2026-04-01 12:00:00 +08:00
zzq0826
b98f054eaa update guide (#483) 2026-04-01 12:00:00 +08:00
Fanis Katsimpas
266425d5ac Fix broken link to design docs 2026-04-01 12:00:00 +08:00
Aaditya S
464432e194 docs: fix typo (#440) 2026-04-01 12:00:00 +08:00
Luck Feng
dba421d2c5 docs: add document for console recording and playback (#435)
* docs: add document for console recording and playback

* docs: adjust some sentences
2026-04-01 12:00:00 +08:00
Yanzhen Yu
aeeafddb46 update docs 2026-04-01 12:00:00 +08:00
Yanzhen Yu
9d686d4302 remove the internal use of resume API 2026-04-01 12:00:00 +08:00
Yanzhen Yu
153035f4b0 turn some warning message into debug message 2026-04-01 12:00:00 +08:00
Yanzhen Yu
3158c87443 update auto play option in the guide 2026-04-01 12:00:00 +08:00
Yanzhen Yu
e2bc867b2e move all events to an enum and update guide 2026-04-01 12:00:00 +08:00
Mike MacCana
2a4c40ff0b Small fixes to English around rrwebRecord / rrweb.record (#41)
* Small fixes to English around rrwebRecord / rrweb.record

* Fix missing word
2026-04-01 12:00:00 +08:00
yz-yu
081781d1ca add checkout config to recorder (#36)
* add checkout config to recorder

* add test cases for checkout feature and extract assertSnapshot method
2026-04-01 12:00:00 +08:00
Yanzhen Yu
21465e785f resolve #13 add warning messages when target is not found 2026-04-01 12:00:00 +08:00
Yanzhen Yu
fc941aa89e update Chinese guide doc 2026-04-01 12:00:00 +08:00
Charlie Jonas
fac101f3c7 demonstrating how to stop recording (#20)
* demonstrating how to stop recording

* made record stop example seperate
2026-04-01 12:00:00 +08:00
Bozhidar Kirev
817d191560 Fixed typo in guide.md (#8)
supoorted -> supported
2026-04-01 12:00:00 +08:00
Yanzhen Yu
ee41434a70 update docs and add compatibility note 2026-04-01 12:00:00 +08:00
Yanzhen Yu
a5f6cb92c7 update docs 2026-04-01 12:00:00 +08:00