From 1b62620e5289216311ca86a90dd900d0f25b41e5 Mon Sep 17 00:00:00 2001 From: Yun Feng Date: Wed, 23 Jun 2021 13:45:12 +0800 Subject: [PATCH] doc: update guide.zh_CN.md --- guide.md | 6 +++--- guide.zh_CN.md | 14 +++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/guide.md b/guide.md index ecb35fcd1f..f40bc4074b 100644 --- a/guide.md +++ b/guide.md @@ -141,9 +141,9 @@ The parameter of `rrweb.record` accepts the following options. | checkoutEveryNth | - | take a full snapshot after every N events
refer to the [checkout](#checkout) chapter | | checkoutEveryNms | - | take a full snapshot after every N ms
refer to the [checkout](#checkout) chapter | | blockClass | 'rr-block' | Use a string or RegExp to configure which elements should be blocked, refer to the [privacy](#privacy) chapter | +| blockSelector | null | Use a string to configure which selector should be blocked, refer to the [privacy](#privacy) chapter | | ignoreClass | 'rr-ignore' | Use a string or RegExp to configure which elements should be ignored, refer to the [privacy](#privacy) chapter | | maskTextClass | 'rr-mask' | Use a string or RegExp to configure which elements should be masked, refer to the [privacy](#privacy) chapter | -| blockSelector | null | Use a string to configure which selector should be blocked, refer to the [privacy](#privacy) chapter | | maskTextSelector | null | Use a string to configure which selector should be masked, refer to the [privacy](#privacy) chapter | | maskAllInputs | false | mask all input content as \* | | maskInputOptions | { password: true } | mask some kinds of input \*
refer to the [list](https://github.com/rrweb-io/rrweb-snapshot/blob/6728d12b3cddd96951c86d948578f99ada5749ff/src/types.ts#L72) | @@ -164,9 +164,9 @@ You may find some contents on the webpage which are not willing to be recorded, - An element with the class name `.rr-block` will not be recorded. Instead, it will replay as a placeholder with the same dimension. - An element with the class name `.rr-ignore` will not record its input events. -- Mask options to mask the content in input elements. -- `input[type="password"]` will be masked by default. - All text of elements with the class name `.rr-mask` and their children will be masked. +- `input[type="password"]` will be masked by default. +- Mask options to mask the content in input elements. #### Checkout diff --git a/guide.zh_CN.md b/guide.zh_CN.md index e85e0a92bb..b17d478bfd 100644 --- a/guide.zh_CN.md +++ b/guide.zh_CN.md @@ -137,11 +137,14 @@ setInterval(save, 10 * 1000); | checkoutEveryNth | - | 每 N 次事件重新制作一次全量快照
详见[“重新制作快照”](#重新制作快照)章节 | | checkoutEveryNms | - | 每 N 毫秒重新制作一次全量快照
详见[“重新制作快照”](#重新制作快照)章节 | | blockClass | 'rr-block' | 字符串或正则表达式,可用于自定义屏蔽元素的类名,详见[“隐私”](#隐私)章节 | -| blockSelector | null | 字符串或正则表达式,可用于自定义屏蔽元素的选择器,详见[“隐私”](#隐私)章节 | +| blockSelector | null | 所有element.matches(blockSelector)为true的元素都不会被录制,回放时取而代之的是一个同等宽高的占位元素 | | ignoreClass | 'rr-ignore' | 字符串或正则表达式,可用于自定义忽略元素的类名,详见[“隐私”](#隐私)章节 | +| maskTextClass | 'rr-mask' | 字符串或正则表达式,可用于自定义忽略元素text内容的类名,详见[“隐私”](#隐私)章节 | +| maskTextSelector | null | 所有element.matches(maskTextSelector)为true的元素及其子元素的text内容将会被屏蔽 | | maskAllInputs | false | 将所有输入内容记录为 \* | | maskInputOptions | { password: true } | 选择将特定类型的输入框内容记录为 \*
类型详见[列表](https://github.com/rrweb-io/rrweb-snapshot/blob/6728d12b3cddd96951c86d948578f99ada5749ff/src/types.ts#L72) | | maskInputFn | - | 自定义特定类型的输入框内容记录逻辑 | +| maskTextFn | - | 自定义文字内容的记录逻辑 | | slimDOMOptions | {} | 去除 DOM 中不必要的部分
类型详见[列表](https://github.com/rrweb-io/rrweb-snapshot/blob/6728d12b3cddd96951c86d948578f99ada5749ff/src/types.ts#L91) | | inlineStylesheet | true | 是否将样式表内联 | | hooks | {} | 各类事件的回调
类型详见[列表](https://github.com/rrweb-io/rrweb/blob/9488deb6d54a5f04350c063d942da5e96ab74075/src/types.ts#L207) | @@ -157,8 +160,9 @@ setInterval(save, 10 * 1000); - 在 HTML 元素中添加类名 `.rr-block` 将会避免该元素及其子元素被录制,回放时取而代之的是一个同等宽高的占位元素。 - 在 HTML 元素中添加类名 `.rr-ignore` 将会避免录制该元素的输入事件。 -- 配置中还有更为丰富的隐私保护选项。 +- 所有带有`.rr-mask`类名的元素及其子元素的text内容将会被屏蔽。 - `input[type="password"]` 类型的密码输入框默认不会录制输入事件。 +- 配置中还有更为丰富的隐私保护选项。 #### 重新制作快照 @@ -286,7 +290,7 @@ replayer.pause(5000); | showDebug | false | 是否在回放过程中打印 debug 信息 | | blockClass | 'rr-block' | 需要在回放时展示为隐藏区域的元素类名 | | liveMode | false | 是否开启直播模式 | -| insertStyleRules | [] | 可以传入多个 CSS rule string,用于自定义回放时 iframe 内的样式 | +| insertStyleRules | [] | 可以传入多个 CSS rule string,用于自定义回放时 iframe 内的样式 | | triggerFocus | true | 回放时是否回放 focus 交互 | | UNSAFE_replayCanvas | false | 回放时是否回放 canvas 内容,**开启后将会关闭沙盒策略,导致一定风险** | | mouseTail | true | 是否在回放时增加鼠标轨迹。传入 false 可关闭,传入对象可以定制轨迹持续时间、样式等,配置详见[类型](https://github.com/rrweb-io/rrweb/blob/9488deb6d54a5f04350c063d942da5e96ab74075/src/types.ts#L407) | @@ -374,8 +378,8 @@ replayer.on(EVENT_NAME, (payload) => { 使用 `rrweb-player` 时,也可以通过 `addEventListener` API 使用相同的事件功能,并且会获得 3 个额外的事件: -| 事件类型 | 描述 | 值 | -| ---------------------- | -------------- | ----------------------- | +| 事件类型 | 描述 | 值 | +| ---------------------- | -------------- | ----------- | | ui-update-current-time | 当前回放时间点 | { payload } | | ui-update-player-state | 当前回放状态 | { payload } | | ui-update-progress | 当前回放百分比 | { payload } |