Commit Graph

1113 Commits

Author SHA1 Message Date
Yun Feng
267e990dc0 Fix: processed-node-manager is created even in the environment that doesn't need a recorder (#1186)
* Fix: processed-node-manager is created even in the environment that doesn't need a recorder

* apply Justin's suggestion

End the RAF loop when the recorder stops
2023-03-24 17:55:22 +11:00
Francesco Novy
a225d8e141 feat: Allow to pass errorHandler as record option (#1107)
* feat: Allow to pass `errorHandler` as record option

* add docs

* Apply formatting changes
2023-03-22 10:24:36 +08:00
Francesco Novy
d2582e9a81 feat: Ensure password inputs are masked when switching type (#1170)
* feat: Ensure password inputs are masked when switching type


Apply formatting changes

use data- attribute


ref: Ensure type is always lowercased


add changeset

* extract into util

* Apply formatting changes
2023-03-20 20:13:23 +08:00
Eoghan Murray
a82a3b42b1 Extend the suppression of warnings to take into account anscestors (#1145)
* Extend the suppression of warnings to take account that a prior removal may not have been against the immediate parent of a subsequent removal, but rather some anscestor

* Create proud-experts-jam.md

* Apply formatting changes
2023-03-18 17:51:52 +11:00
fukang wang
e0f862bac7 fix: worker_thread warning (#1179)
* fix: worker_thread warning

* Create fast-chefs-smell.md

* Apply formatting changes

* Update fast-chefs-smell.md
2023-03-18 17:21:49 +11:00
fukang wang
5982c8972a fix: Cannot set property attributeName of #<MutationRecord> which has only a getter (#1173)
* fix: Cannot set property attributeName of #<MutationRecord> which has only a getter

* fix: attributeName readonly
2023-03-15 18:11:02 +08:00
sky
4cb4d0e95a improve: some websites rebuild imcomplete (#1163)
* improve: mutation.ts, loop use Set replace Array

* improve: add a try-catch to utils.ts to make it robust

* Create yellow-mails-cheat.md

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-03-13 14:29:48 +08:00
fukang wang
e7f0c808c3 fix: inline images onload (#1174)
* fix: inline images onload

* add integration test case

* Apply formatting changes

* Create small-olives-arrive.md

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-03-13 13:56:09 +08:00
github-actions[bot]
1f8e5d5675 Version Packages (alpha) (#1138) 2023-03-08 16:06:25 +08:00
Justin Halsall
4948c3006a Fix changesets patch level of PR #1159 (#1169)
* Fix changesets patch level of PR #1159

* Create twenty-planets-repeat.md

* Apply formatting changes
2023-03-08 15:53:42 +08:00
Justin Halsall
d292167997 Add tsdoc/jsdoc deprecated notice to Mirror (#1168) 2023-03-08 08:19:37 +01:00
Yun Feng
f27e545e18 Fix: Switch to real dom before rebuilding fullsnapshot (#1139) 2023-03-08 08:19:00 +01:00
Eoghan Murray
d82c5edfff Update CONTRIBUTING.md (#1165)
* Update CONTRIBUTING.md

Add info about Changesets

* Apply formatting changes
2023-03-05 08:07:36 +11:00
Francesco Novy
eac9b18bbf feat: Ignore autoplay attribute on video/audio elements (#1152)
* feat: Ignore `autoplay` attribute on video/auto elements

This element leads to weird issues when replaying, so it's better to strip this out.

* add changeset

* fix check


fix typo

* Apply formatting changes

---------

Co-authored-by: mydea <mydea@users.noreply.github.com>
2023-03-03 13:01:02 +01:00
Eoghan Murray
5e6c132a4d Set userTriggered to false on Input attribute modifications (#1159)
* Set userTriggered to false on Input attribute modifications

 - the fact we are intercepting them via hook rather than an event suggests to me that they could well be programmatic

* Create young-timers-grow.md
2023-03-03 11:35:50 +01:00
Francesco Novy
8e47ca1021 fix: Explicitly handle null attribute values (#1157)
* fix: Explicitly handle removed attributes

The attribute `value` can be null when a mutation observer triggers due to a removed attribute. This is currently not reflected by types and code.

* Apply formatting changes

* fix

* add changeset
2023-02-28 03:32:56 +08:00
Pravin Tiwari
e65465e808 fix the statement which is getting changed by Microbundle (#1156)
* fix the statement which is getting changed by microbundle

* Create chatty-cherries-train.md

* fix formatting.

* fix position of comment

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2023-02-27 08:58:15 +01:00
Eoghan Murray
c28ef5f658 Replay fix for Firefox — add <head> and <body> separately (#1133)
* Firefox fix: Allow the <head> and <body> to be added in two stages so that (presumably) stylesheet rules are ready to be applied when the body appears

The css which triggered the bug was simply

{
  margin-left: 220px;
  transition: margin-left .448s;
}

* Add a test case which can only be appreciated if you record against this file://, save the events to a html file, and then open the file in Firefox (without this PR applied)

* Apply formatting changes

* Ensure we don't apply this branch when using rrdom, where it is not necessary

* Apply formatting changes

* Rewrite insertion in order to be compatible with rrdom

Also easier to understand

* Delete transition.html

* Create grumpy-ways-own.md

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-02-22 16:45:29 +11:00
Neil Han
be54981358 chore: web-extension vite.config.ts needs these changes to work for node 14 (#1146) 2023-02-19 15:57:47 +08:00
Yun Feng
3416c3a769 fix: isCheckout is not included in fullsnapshot event (#1141)
* fix: isCheckout is not included in fullsnapshot event

* add change log
2023-02-17 08:50:58 +01:00
Ben White
aaabdbdff5 fix: Recursive logging bug with console recording (#1136)
* fix: Recursive logging bug with console recording

* Create violet-melons-itch.md
2023-02-16 17:11:31 +08:00
Prateek Karnal
f6f07e9533 Fix relative path detection in stylesheet URLs (#1130)
* Fix relative path detection in stylesheet URLs

* Add a check for www.

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

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

* Create large-ants-prove.md

* Update large-ants-prove.md

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-02-15 16:42:29 +01:00
github-actions[bot]
06031a6486 Version Packages (alpha) (#1135) 2023-02-15 06:37:19 +08:00
Yun Feng
033d2d18b4 some minor changes for releasing the extension and revert failed publish PR #1123 (#1132)
* improve extension bundle

* Revert "Version Packages (alpha) (#1123)"

This reverts commit 39f8c24f1d.
2023-02-15 06:32:43 +08:00
Justin Halsall
28111c14b1 Fix broken changeset release action (#1134)
* Fix broken changeset release action

* Create mighty-frogs-sparkle.md
2023-02-15 08:39:23 +11:00
github-actions[bot]
39f8c24f1d Version Packages (alpha) (#1123)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-02-14 15:51:42 +01:00
Billy Vong
b540c047c2 fix: Exclude scripts loaded with rel=modulepreload from snapshots (#1128)
* fix: Exclude `modulepreload` as well

We were only excluding `<link rel="preload" as="script" />` but we should include `rel="modulepreload"` as well

* Apply formatting changes
2023-02-14 12:06:59 +01:00
Justin Halsall
f9affc9747 Chore: Bump up all package versions together whenever any one version changes (#1131)
* Bump up all package versions together whenever any one version changes.

Keeps everything in sync to make it easy to see if you have the correct dependencies.

https://github.com/changesets/changesets/blob/main/docs/fixed-packages.md

* Empty changeset as this changes nothing for the packages them selves

* Bring @rrweb/web-extension version inline with other packages

* separate the extension version from package.json's to avoid errors

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-02-14 11:54:59 +01:00
Yun Feng
3cc4323094 improve rrdom performance (#1127)
* add more check to rrdom to make diff algorithm more robust

* fix: selector match in iframe is case-insensitive

add try catch to some fragile points

* test: increase timeout value for Jest

* improve code style

* fix: failed to execute insertBefore on Node in the diff function

this happens when ids of doctype or html element are changed in the virtual dom

also improve the code quality

* refactor diff function to make the code cleaner

* fix: virtual nodes are passed to plugin's onBuild function

* refactor the diff function and adjust the order of diff work.

* call afterAppend hook in a consistent traversal order

* improve the performance of the "contains" function

reduce the complexity from O(n) to O(logn)
a specific benchmark is needed to add further

* add a real events for benchmark

* refactor: change the data structure of childNodes from array to linked list

* remove legacy code in rrweb package

* update unit tests

* update change log
2023-02-14 11:54:30 +01:00
Yun Feng
282c8fa415 rrweb extension implementation (#1044)
* feat: add rrweb web-extension package

* refactor: make the extension suitable for manifest v3

* update tsconfig.json

* use version_name rather than recorder_version in manifest.json

* update manifest.json

* enable to keep recording after changing tabs

* enable to record between tabs and urls

* fix CI error

* try to fix CI error

* feat: add pause and resume buttons

* feat: add a link to new session after recording

* improve session list

* refactor: migrate session storage from chrome local storage to indexedDB

* feat: add pagination to session list

* fix: multiple recorders are started after pausing and resuming process

* fix: can't stop recording on firefox browser

* update type import of 'eventWithTime'

* fix CI error

* doc: add readme

* Apply suggestions from Justin's code review

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

* refactor: make use of webNavigation API to implement recording consistent during page navigation

* fix firefox compatibility issue and add title to pages

* add mouseleave listener to enhance the recording liability

* fix firefox compatibility issue and improve the experience of recording resume after closing tabs

* update tsconfig

* upgrade vite-plugin-web-extension config to fix some bugs on facebook web page

* update import links

* refactor: cross tab recording mechanism

apply Justin's suggestion

* refactor: slipt util/index.ts into multiple files

* implement cross-origin iframe recording

* fix: regression of issue: ShadowHost can't be a string (issue 941)

* refactor shadow dom recording to make tests cover key code

* Apply formatting changes

* increase the node memory limitation to avoid CI failure

* Create lovely-pears-cross.md

* Apply formatting changes

* Update packages/web-extension/package.json

* Update .changeset/lovely-pears-cross.md

* update change logs

* delete duplicated property

---------

Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2023-02-14 07:15:34 +08:00
Yun Feng
227d43abb9 refine change logs (#1126) 2023-02-12 14:47:51 +01:00
Yun Feng
1385f7acc0 fix duplicated shadow dom (#1095)
* fix: duplicated elements in shadow doms

clean observers before taking new full snapshots

* add checker for replayer to make it stable when data has duplicated nodes

* apply review suggestions

* add change log

* Apply formatting changes

* update prettier to fit the master branch

---------

Co-authored-by: Mark-Fenng <Mark-Fenng@users.noreply.github.com>
2023-02-12 14:00:18 +01:00
Justin Halsall
2946f102ff Add needed dependency for changeset formatter (#1125) 2023-02-12 13:50:28 +01:00
Justin Halsall
fdce994018 Add friendly changelog message (#1124)
* Add friendly changelog message

* add empty changelog
2023-02-12 13:39:52 +01:00
Yun Feng
502d15df9f fix: outdated ':hover' styles can't be removed from iframes or shadow doms (#1121)
* fix :hover class can't be removed in iframes

* add test case and change log
2023-02-12 13:25:21 +01:00
Yun Feng
8d209a62f3 add change log and update readme (#1122) 2023-02-12 13:22:05 +01:00
Justin Halsall
5a1e5e919e Automate NPM package releases (#1119) 2023-02-11 10:19:52 +01:00
Yun Feng
174b9ac066 fix: mutation Failed to execute 'insertBefore' on 'Node': Only one doctype on document allowed (#1112)
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2023-02-09 20:21:45 +08:00
Yun Feng
0627d4df7c add option to record on DOMContentLoaded event (#1109) 2023-02-09 10:14:49 +01:00
Yun Feng
07d22e7cd9 enable to customize logger in the replayer (#1111) 2023-02-09 10:14:33 +01:00
Yun Feng
4ee86fe66d improve rrdom robustness (#1091) 2023-02-09 10:10:32 +01:00
Yun Feng
3a26e36f6f fix: regression of issue: ShadowHost can't be a string (issue 941) (#1092) 2023-02-09 10:09:58 +01:00
Eoghan Murray
3caa25ed9b Don't have requestAnimationFrame looping in background for Live Mode (#1098) 2023-02-09 10:02:38 +01:00
Yun Feng
07326182f9 fix: wrong rootId value in special iframes (#1100)
1. When some same-origin iframes are nested in cross-origin iframes, their `rootId`s are wrong.

2. The property `rootId` is missing in serialized cross-origin iframes
2023-02-09 16:23:19 +08:00
Francesco Novy
cb1580008d fix: Ensure CSS support is checked more robustly (#1106)
* fix: Ensure CSS support is checked more robustly

* Apply formatting changes

* apply eslint changes

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

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

* fix: do not use window in module scope

---------

Co-authored-by: mydea <mydea@users.noreply.github.com>
Co-authored-by: Justin Halsall <Juice10@users.noreply.github.com>
2023-02-09 09:19:53 +01:00
Justin Halsall
25a4f5ab6c [fix] Don't trigger Finish event when in liveMode (#1115) 2023-02-09 08:48:57 +01:00
James Berry
a77e302178 [console-plugin] Feat: Record unhandledrejection event (#1104)
* feat/console-plugin/add-unhandledrejection-handler

* better error

* change the window object to the passed in 'win'

* empty

* improve serialized error messages

---------

Co-authored-by: Yun Feng <yun.feng0817@gmail.com>
2023-02-06 10:28:51 +08:00
dependabot[bot]
7e002b9bda chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#1108)
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-06 10:27:30 +08:00
Yun Feng
fc82869409 Fix cross origin iframe bugs (#1093)
* 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
2023-01-16 15:26:33 +08:00
Francesco Novy
57a2e140ea feat: Guard against missing window.CSSStyleSheet (#1088) 2023-01-13 13:11:57 +08:00