forked from rrweb-io/rrweb
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat pass element to maskTextFn #99
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…o#868) * Move ids to weakmap * Fix typo * Move from INode to storing serialized data in mirror * Update packages/rrweb-snapshot/src/rebuild.ts Co-authored-by: Yun Feng <[email protected]> * Remove unnessisary `as Node` typecastings Fixes: rrweb-io#868 (comment) * Remove unnessisary `as unknown as ...` * Remove unnessisary `as unknown as ...` * Reset mirror when recording starts Solves: rrweb-io#868 (comment) * API has changed for snapshot, change test to reflect that * Allow for es5 compatibility * Remove unnessisary as unknown as ... and change test to reflect the API change * Refactor mirror to remove `nodeIdMap` Fixes: rrweb-io#868 (comment) Co-authored-by: Yun Feng <[email protected]>
* Fix mutation edge case when blocked class gets unblocked * Add integration test * Update isSerialized logic
* 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: rrweb-io#859 (comment)
* Perf: apply the latest text mutation only * Find unique text mutations in one iteration
…optimization (rrweb-io#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 <[email protected]> * 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 rrweb-io#865 to virtual-dom and improve the test case for more coverage * apply review suggestions rrweb-io#853 (review) * 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 b1be81a. * 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: b7b3c8d 72e23b8 85d600a 61e1a5d * 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 rrweb-io#887 in 'virtual-dom' branch * apply justin's suggestion on 'Array.from' refactor related commit 0f6729d * improve import code structure Co-authored-by: Yun Feng <[email protected]>
…rweb-io#897) * housekeeping: refine test utils * setup benchmark tests * improve snapshot attributes loop perf
…rweb-io#900) * Add linting * Add issue templates and docs * Add root eslint config and remove tslint * Autofix lint issues
Properly remove crossorigin attribute
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Speed up snapshotting of many new dom nodes By avoiding reflow we shave about 15-25% off our snapshotting time * Improve newlyAddedElement docs * Optimize needMaskingText by using el.closest and less recursion * Serve all rrweb dist files * Split serializeNode into smaller functions Makes it easier to profile * Slow down cpu enhance tracing on fast machines * Increase timeout * Perf: only loop through ancestors when they have something to compare to * Perf: `hasNode` is cheaper than `getMeta` * Perf: If parents where already checked, no need to do it again * Perf: reverse for loops are faster Because they only do the .lenght check once. In this case I don't think we'll see much performance gains if any * Clean up code * Perf: check ancestors once with isBlocked * guessing this might fixes canvas test * Update packages/rrweb/src/record/observers/canvas/webgl.ts Co-authored-by: yz-yu <[email protected]> * Fix rrweb-io#904 (rrweb-io#906) Properly remove crossorigin attribute * Bump minimist from 1.2.5 to 1.2.6 (rrweb-io#902) Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: yz-yu <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* integrate turborepo in monorepo * integrate turborepo in monorepo
* Lock yarn to 1.23.0 * fix flaky test * Fix flaky tests
* Remove children of Document even if doc not in mirror * fix flaky test * Update packages/rrdom/test/diff.test.ts Co-authored-by: Yun Feng <[email protected]> Co-authored-by: Yun Feng <[email protected]>
* inline stylesheets when loaded * set empty link elements to loaded by default * Clean up stylesheet manager * Remove attribute mutation code * Update packages/rrweb/test/record.test.ts * Update packages/rrweb/test/record.test.ts * Update packages/rrweb/test/record.test.ts * Update packages/rrweb/scripts/repl.js * Update packages/rrweb/test/record.test.ts * Update packages/rrweb/src/record/index.ts * Add todo * Move require out of time sensitive assert * Add waitForRAF, its more reliable than waitForTimeout * Remove flaky tests * Add recording stylesheets in iframes * Remove variability from flaky test * Make test more robust * Fix naming
…-io#925) * test: update cssom package to rrweb self-owned package 'rrweb-cssom' * style: remove outdated comments
Bumps [parse-url](https://github.com/IonicaBizau/parse-url) from 6.0.0 to 6.0.2. - [Release notes](https://github.com/IonicaBizau/parse-url/releases) - [Commits](https://github.com/IonicaBizau/parse-url/commits) --- updated-dependencies: - dependency-name: parse-url dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* refactor: eliminate eslint errors as many as I can * refactor: fix more eslint errors in the record module * LINT: fix @typescript-eslint/unbound-method * LINT: fix all eslint errors in source code * LINT: fix as many eslint warnings as possible Co-authored-by: Justin Halsall <[email protected]>
* refactor: eliminate eslint errors as many as I can * refactor: fix more eslint errors in the record module * LINT: fix @typescript-eslint/unbound-method * LINT: fix all eslint errors in source code * LINT: fix as many eslint warnings as possible * CI: add a github action to check ESLINT status * CI: update github action * build: update travis CI and github action * CI: update github action * CI: update job name * CI: restore test command from turbo to lerna * Merge branch master into eslint-action Co-authored-by: Justin Halsall <[email protected]>
Bumps [terser](https://github.com/terser/terser) from 5.7.1 to 5.14.2. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/commits) --- updated-dependencies: - dependency-name: terser dependency-type: indirect ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [svelte](https://github.com/sveltejs/svelte) from 3.40.0 to 3.49.0. - [Release notes](https://github.com/sveltejs/svelte/releases) - [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md) - [Commits](sveltejs/svelte@v3.40.0...v3.49.0) --- updated-dependencies: - dependency-name: svelte dependency-type: direct:development ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… where a subsequent click would be picked up as a touch (see `thisEventKey` change)
Pointer type fixups
* Add gold sponsors * Create empty-bikes-cheer.md
* Reduce verbosity/redundancy of output of new pointerType attribute by confining it only to clicks (and to a MouseDown/MouseUp from a PointerTypes.Pen, as these don't yet have a dedicated PendDown/PenUp) * Update how the changeset will read for the next release based on the trimming in this PR * Prefer triple equals * The assignment to the outer `pointerType` variable in an anonymous function was somehow missed by the `typings` check * Apply formatting changes * Update packages/rrweb/src/record/observer.ts * Update packages/rrweb/src/record/observer.ts --------- Co-authored-by: Yun Feng <[email protected]>
* Add highlight to "who's using rrweb" * Create rich-crews-protect.md
* perf: record processMutation * Create mean-tips-impress.md * Apply formatting changes
… tool (rrweb-io#1197) * refactor rrvideo: use playwright rather than puppeteer * add a progress bar for the tool * add tests for cli.ts * fix build error * add change log * update readme file * Apply a scaling method to improve the resolution of the output video
* Scale sponsors Gold sponsors where a bit too big. I've scaled down all sponsors to match their donation level (calculation below). Also makes the low res image of our gold sponsor less apparent. Example: Bronze Sponsors Calculation: 50 pixels per donation $ 100$ = 5000 pixels √5000 = +/-70 Resolution: 70*70 = +/-5000 pixels * Create fresh-cars-impress.md
* Warn instead of throwing error when parsing for console logs * Added error to warning
* perf: optimize performance of the DoubleLinkedList get * fix: delete addedNodeIndexArr
Added analyzee as one of the SaaS that use rrweb in one of their products
* Fix for rrweb-io#816 - avoid triggering a CSP (content security policy) error with `.setAttribute('style')` * The bare unattachedDoc that I previously naively created didn't have a doctype and wasn't a HTML document, so the child style element didn't have the `old.style` attribute available * Add a try/catch to provide some robustness in case `document.implementation.createHTMLDocument` isn't available
* fix turbo dev command errors * Create forty-elephants-attack.md --------- Co-authored-by: Justin Halsall <[email protected]>
* fix: rrdom bug 1. fix one bug of the diff algorithm 2. omit srcdoc attribute of iframe * use linked list to iterate children * fix the bug that the children of shadowRoot don't get diffed * add test cases * add change log
* fix: Ensure attributes are lowercased when checking * add changeset * fix to lower case * Apply formatting changes --------- Co-authored-by: mydea <[email protected]>
* As per @yun Feng: everyone has npm installed globally but maybe not yarn * Add command to enable test result updating * Default to running tests HEADLESS on rrweb * Add command to build:all in a low memory environment * Add a 'retest' command for when the code hasn't changed, but you are working on the test cases * Add commands to reformat according to prettier. Named 'reformat' to indicate that we are doing a `--write` * Update package.json Co-authored-by: Yun Feng <[email protected]> * Apply suggestions from code review Co-authored-by: Yun Feng <[email protected]> * Create few-turkeys-reflect.md * Apply formatting changes --------- Co-authored-by: Justin Halsall <[email protected]> Co-authored-by: Yun Feng <[email protected]>
* Guard against presence of likely older third party libraries which (re)define Date.now, e.g. datejs/Datejs#92 * Apply formatting changes * (remove nowTimestamp import where Date.now() is not used) * Add a PURE marker so an empty `ìf` statement doesn't show up in the rrweb-replay output * Update packages/rrweb/src/utils.ts Fix typing issue with regex against `Date.now()` Co-authored-by: Justin Halsall <[email protected]> * Create little-radios-thank.md * Apply formatting changes * Update .changeset/little-radios-thank.md * Apply formatting changes --------- Co-authored-by: eoghanmurray <[email protected]> Co-authored-by: Justin Halsall <[email protected]>
* Export correct mirror in player Was using DeprecatedMirror in its types, that shouldn't be used anymore. * Add playRange to types * Create smooth-poems-bake.md * Apply formatting changes * Add $set to player type * Update smooth-poems-bake.md * Apply formatting changes * Last two arguments of playRange are optional
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Allows `maskTextFn` to access to parent element or node so that it can make masking decisions based on the element.
it('should generate a video with specific output path', () => { | ||
const outputFile = path.resolve(__dirname, './generated/output.webm'); | ||
execSync( | ||
`node ./build/cli.js --input ./test/generated/example.json --output ${outputFile}`, |
Check warning
Code scanning / CodeQL
Shell command built from environment values
This shell command depends on an uncontrolled [absolute path](1).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
node.__sn
) and use Mirror as source of truth (Remove INode (node.__sn
) and use Mirror as source of truth rrweb-io/rrweb#868)npm run typings
from theirsrc/types.ts
masters, and are an extra source of conflicts if they remain in git (Remove types.d.ts rrweb-io/rrweb#946)addAction
wouldn't have any effect without a stop and start (Fix thataddAction
wouldn't have any effect without a stop and start rrweb-io/rrweb#1001)play
to live-mode.md (Addplay
to live-mode.md rrweb-io/rrweb#1009)rr_*
attributes handled last (bugfix: Sort attributes to makerr_*
attributes handled last rrweb-io/rrweb#970)afterAppend
for mutations and top level elements (Bug: CallafterAppend
for mutations and top level elements rrweb-io/rrweb#1012)prototype
here does not refer to the correct WebGLRenderingContext … (prototype
here does not refer to the correct WebGLRenderingContext … rrweb-io/rrweb#1013)background-clip: text
with browser prefix (Fix: Capture CSSbackground-clip: text
with browser prefix rrweb-io/rrweb#1047)recordOptions
type (ExportrecordOptions
types rrweb-io/rrweb#1067)window.CSSStyleSheet
(feat: Guard against missingwindow.CSSStyleSheet
rrweb-io/rrweb#1088)unhandledrejection
event ([console-plugin] Feat: Recordunhandledrejection
event rrweb-io/rrweb#1104)rel=modulepreload
from snapshots (fix: Exclude scripts loaded withrel=modulepreload
from snapshots rrweb-io/rrweb#1128)null
attribute values (fix: Explicitly handlenull
attribute values rrweb-io/rrweb#1157)autoplay
attribute on video/audio elements (feat: Ignoreautoplay
attribute on video/audio elements rrweb-io/rrweb#1152)errorHandler
as record option (feat: Allow to passerrorHandler
as record option rrweb-io/rrweb#1107)e
ended up as a TouchEvent instead of an individual Touch object I thinkpointerType
shows up in clicks in these tests on my machine;0=PointerTypes.Mouse
is expectedthisEventKey
change)maskTextFn