* 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
* 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>
* 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>
* 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
* 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
* 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>
* 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>
In certain cases when scrollLeft is being set, but the value doesn't change. Then scrollTop is also ignored, even if that value was changed.
In this case we use the `scrollTo` api as it doesn't have that issue.
* Chore: Add move most types from rrweb to @rrweb/types package
* Split off type imports
* Split off type import to its own line
* Get vite to generate type definitions
* Apply formatting changes
* noEmit not allowed in tsconfig, moved it to build step
* Align version of @rrweb/types with main rrweb package
Based on @mark-fenng's comments https://github.com/rrweb-io/rrweb/pull/1031/files#r1002298176
* Move up keywords
* `prototype` here does not refer to the correct WebGLRenderingContext when there are multiple being patched - all were referring to the same one meaning that variables weren't being indexed correctly as `canvasVarMap` in serialize-args.ts was only seeing a single context
If you revert the change from `prototype` to `this` from this commit, you'll get the following failure in the new test added in this commit:
@@ -199,11 +199,11 @@
"property": "bindBuffer",
"args": [
34962,
{
"rr_type": "WebGLBuffer",
- "index": 0
+ "index": 1
}
]
},
This is because the 'confound' canvas was populating a single entry in the canvasVarMap so when 'myCanvas' starts populating, there is already an entry (which doesn't exist on the replay side as the 'confound' canvas was never emitted)
* Update packages/rrweb/test/integration.test.ts
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* Update packages/rrweb/test/html/canvas-webgl-shader.html
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* fix: bug when inlined link elements
* test: update snapshot for test cases
* apply Justin's review suggestions
1. make Mirror's replace function act the same with the original one when there's no existed node to get replaced.
2. when replacing with the link/style elements, keep their existing attributes to prevent potential bugs
* test(recording side): add test case for adopted stylesheets in shadow doms and iframe
* add type definition for adopted StyleSheets
* create a StyleSheet Mirror
* enable to record the outermost document's adoptedStyleSheet
* enable to serialize all stylesheets in documents (iframe) and shadow roots
* enable to record adopted stylesheets while building full snapshot
* test: add test case for mutations on adoptedStyleSheets
* defer to record adoptedStyleSheets to avoid create events before full snapshot
* feat: enable to track the mutation of AdoptedStyleSheets
* Merge branch 'fix-shadowdom-record' into construct-style
* fix: incorrect id conditional judgement
* test: add a test case for replaying side
* tweak the style mirror for replayer
* feat: enable to replay adoptedStyleSheet events
* fix: rule index wasn't recorded when serializing the adoptedStyleSheets
* add test case for mutation of stylesheet objects and add support for replace & replaceSync
* refactor: improve the code quality
* feat: monkey patch adoptedStyleSheet API to track its modification
* feat: add support for checkouting fullsnapshot
* CI: fix failed type checks
* test: add test case for nested shadow doms and iframe elements
* feat: add support for adoptedStyleSheets in VirtualDom mode
* style: format files
* test: improve the robustness of the test case
* CI: fix an eslint error
* test: improve the robustness of the test case
* fix: adoptedStyleSheets not applied in fast-forward mode (virtual dom optimization not used)
* refactor the data structure of adoptedStyleSheet event to make it more efficient and robust
* improve the robustness in the live mode
In the live mode where events are transferred over network without strict order guarantee, some newer events are applied before some old events and adopted stylesheets may haven't been created.
Added a retry mechanism to solve this problem.
* apply Yanzhen's review suggestion
* update action name
* test: make the test case more robust for travis CI
* Update packages/rrweb/src/record/constructableStyleSheets.d.ts
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* Update packages/rrweb/src/record/constructableStyleSheets.d.ts
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* apply Justin's review suggestions
add more browser compatibility checks
* add eslint-plugin-compat and config
* fix record test type errors
* make Mirror's replace function act the same with the original one when there's no existed node to replace
* test: increase the robustness of test cases
* remove eslint disable in favor of feature detection
Early returns aren't supported yet unfortunately, otherwise this code would be cleaner https://github.com/amilajack/eslint-plugin-compat/issues/523
* Remove eslint-disable-next-line compat/compat
* Standardize browserslist and remove lint exceptions (#1010)
* test: revert deleting virtual style tests and rewrite them to fit the current code base
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
* Sort attributes to make `rr_*` attributes handled last
`rr_dataURL` overwrites `src` attribute, because of this we need to evaluate `rr_dataURL` last so it doesn't accidentally get overwritten again.
* Update packages/rrweb-snapshot/src/rebuild.ts
* Refactor handling of rr_* attributes
Be a little more strict when it comes attribute types
* Update live-mode.md
`play` is superior in the case that there are existing events as it will utilize `discardPriorSnapshots` to skip unnecessary things.
* Apply formatting changes
* Update live-mode.md
tweak
Co-authored-by: eoghanmurray <eoghanmurray@users.noreply.github.com>