Skip to content
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

obfuscate text for highlight-mask class #84

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/rrweb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@highlight-run/rrweb",
"version": "2.1.0",
"version": "2.1.1",
"description": "record and replay the web",
"scripts": {
"prepare": "npm run prepack",
Expand Down
7 changes: 4 additions & 3 deletions packages/rrweb/src/record/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { IframeManager } from './iframe-manager';
import { ShadowDomManager } from './shadow-dom-manager';
import { CanvasManager } from './observers/canvas/canvas-manager';
import { StylesheetManager } from './stylesheet-manager';
import { obfuscateText } from '@highlight-run/rrweb-snapshot';

function wrapEvent(e: event): eventWithTime {
return {
Expand Down Expand Up @@ -59,7 +60,7 @@ function record<T = eventWithTime>(
maskInputOptions: _maskInputOptions,
slimDOMOptions: _slimDOMOptions,
maskInputFn,
maskTextFn,
maskTextFn = obfuscateText,
hooks,
packFn,
sampling = {},
Expand Down Expand Up @@ -251,7 +252,7 @@ function record<T = eventWithTime>(
stylesheetManager,
canvasManager,
keepIframeSrcFn,
enableStrictPrivacy
enableStrictPrivacy,
},
mirror,
});
Expand Down Expand Up @@ -522,7 +523,7 @@ record.addCustomEvent = <T>(tag: string, payload: T) => {
if (!wrappedEmit) {
/* Highlight Code - disable this warning */
// throw new Error('please add custom event after start recording');
return
return;
}
wrappedEmit(
wrapEvent({
Expand Down