Skip to content

docs: add privacy guides and link from main docs#1790

Open
Juice10 wants to merge 4 commits intomasterfrom
juice10/docs-privacy
Open

docs: add privacy guides and link from main docs#1790
Juice10 wants to merge 4 commits intomasterfrom
juice10/docs-privacy

Conversation

@Juice10
Copy link
Member

@Juice10 Juice10 commented Feb 13, 2026

Note: this was vibe documented and skimmed, and is better than what we had but I haven't verified that the recommendations actually make any real sense.

Add comprehensive privacy recipe documentation in English and Simplified Chinese, covering masking, blocking, ignoring, and performance considerations.

Update privacy-related option references in guide.md and guide.zh_CN.md to point to the new dedicated privacy guides.

Add comprehensive privacy recipe documentation in English and
Simplified Chinese, covering masking, blocking, ignoring, and
performance considerations.

Update privacy-related option references in guide.md and
guide.zh_CN.md to point to the new dedicated privacy guides.
Copilot AI review requested due to automatic review settings February 13, 2026 15:09
@changeset-bot
Copy link

changeset-bot bot commented Feb 13, 2026

⚠️ No Changeset found

Latest commit: b39ebd0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Size Change: 0 B

Total Size: 10.1 MB

ℹ️ View Unchanged
Filename Size
packages/all/dist/all.cjs 578 kB
packages/all/dist/all.js 577 kB
packages/all/dist/all.umd.cjs 581 kB
packages/all/dist/all.umd.min.cjs 273 kB
packages/packer/dist/base-DF-ifV6c.cjs 18.3 kB
packages/packer/dist/base-DF-ifV6c.umd.cjs 19.4 kB
packages/packer/dist/base-DF-ifV6c.umd.min.cjs 10.1 kB
packages/packer/dist/base-Dgki_PiJ.js 18.2 kB
packages/packer/dist/pack.cjs 347 B
packages/packer/dist/pack.js 285 B
packages/packer/dist/pack.umd.cjs 2.25 kB
packages/packer/dist/pack.umd.min.cjs 1.73 kB
packages/packer/dist/packer.cjs 257 B
packages/packer/dist/packer.js 136 B
packages/packer/dist/packer.umd.cjs 1.28 kB
packages/packer/dist/packer.umd.min.cjs 1.25 kB
packages/packer/dist/unpack.cjs 769 B
packages/packer/dist/unpack.js 702 B
packages/packer/dist/unpack.umd.cjs 1.79 kB
packages/packer/dist/unpack.umd.min.cjs 1.57 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.cjs 37.6 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.js 37.5 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.umd.cjs 38.7 kB
packages/plugins/rrweb-plugin-canvas-webrtc-record/dist/rrweb-plugin-canvas-webrtc-record.umd.min.cjs 22.9 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.cjs 34.3 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.js 34.2 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.umd.cjs 35.4 kB
packages/plugins/rrweb-plugin-canvas-webrtc-replay/dist/rrweb-plugin-canvas-webrtc-replay.umd.min.cjs 21.2 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.cjs 15 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.js 14.9 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.umd.cjs 16.1 kB
packages/plugins/rrweb-plugin-console-record/dist/rrweb-plugin-console-record.umd.min.cjs 8.03 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.cjs 5.01 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.js 4.9 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.umd.cjs 6.07 kB
packages/plugins/rrweb-plugin-console-replay/dist/rrweb-plugin-console-replay.umd.min.cjs 3.27 kB
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.cjs 681 B
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.js 548 B
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.umd.cjs 1.76 kB
packages/plugins/rrweb-plugin-sequential-id-record/dist/rrweb-plugin-sequential-id-record.umd.min.cjs 1.47 kB
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.cjs 933 B
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.js 820 B
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.umd.cjs 2.01 kB
packages/plugins/rrweb-plugin-sequential-id-replay/dist/rrweb-plugin-sequential-id-replay.umd.min.cjs 1.61 kB
packages/record/dist/record.cjs 397 kB
packages/record/dist/record.js 397 kB
packages/record/dist/record.umd.cjs 400 kB
packages/record/dist/record.umd.min.cjs 184 kB
packages/replay/dist/replay.cjs 410 kB
packages/replay/dist/replay.js 410 kB
packages/replay/dist/replay.umd.cjs 414 kB
packages/replay/dist/replay.umd.min.cjs 196 kB
packages/replay/dist/style.css 2.45 kB
packages/replay/dist/style.min.css 1.97 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.cjs 143 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.js 142 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.umd.cjs 145 kB
packages/rrdom-nodejs/dist/rrdom-nodejs.umd.min.cjs 68.2 kB
packages/rrdom/dist/rrdom.cjs 161 kB
packages/rrdom/dist/rrdom.js 160 kB
packages/rrdom/dist/rrdom.umd.cjs 163 kB
packages/rrdom/dist/rrdom.umd.min.cjs 75.3 kB
packages/rrweb-player/dist/events.js 159 kB
packages/rrweb-player/dist/global.css 240 B
packages/rrweb-player/dist/rrweb-player.cjs 294 kB
packages/rrweb-player/dist/rrweb-player.js 294 kB
packages/rrweb-player/dist/rrweb-player.umd.cjs 296 kB
packages/rrweb-player/dist/rrweb-player.umd.min.cjs 132 kB
packages/rrweb-player/dist/style.css 5.57 kB
packages/rrweb-player/dist/style.min.css 5 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.cjs 176 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.js 175 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.umd.cjs 179 kB
packages/rrweb-snapshot/dist/rrweb-snapshot.umd.min.cjs 83.3 kB
packages/rrweb/dist/rrweb.cjs 560 kB
packages/rrweb/dist/rrweb.js 560 kB
packages/rrweb/dist/rrweb.umd.cjs 561 kB
packages/rrweb/dist/rrweb.umd.min.cjs 264 kB
packages/rrweb/dist/style.css 2.45 kB
packages/rrweb/dist/style.min.css 1.97 kB
packages/types/dist/types.cjs 5.63 kB
packages/types/dist/types.js 5.38 kB
packages/types/dist/types.umd.cjs 6.66 kB
packages/types/dist/types.umd.min.cjs 3.41 kB
packages/utils/dist/utils.cjs 6.25 kB
packages/utils/dist/utils.js 5.74 kB
packages/utils/dist/utils.umd.cjs 7.28 kB
packages/utils/dist/utils.umd.min.cjs 4.09 kB

compressed-size-action

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds dedicated privacy “recipe” guides (EN + Simplified Chinese) and updates the main guides’ option tables to reference these new privacy documents instead of the inline “privacy” sections.

Changes:

  • Added new privacy guides under docs/recipes/ in English and Simplified Chinese.
  • Updated privacy-related option references in guide.md / guide.zh_CN.md to link to the new privacy guides.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
guide.md Updates several privacy option rows to link to the new privacy guide.
guide.zh_CN.md Updates several privacy option rows to link to the new Chinese privacy guide.
docs/recipes/privacy.md Adds a comprehensive English privacy guide (mask/block/ignore/perf).
docs/recipes/privacy.zh_CN.md Adds a comprehensive Simplified Chinese privacy guide (mask/block/ignore/perf).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

record({
emit(event) {
const endTime = performance.now();
console.log(`事件处理时间: ${endTime - startTime}ms`);
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个示例计算的是从 startTime 开始到当前的总耗时,并不是单个事件的“处理时间”。如果想测量 emit 回调本身的耗时,应该把 startTime 放到 emit 内部(或调整文案为“自录制开始的累计耗时”)。

Suggested change
console.log(`事件处理时间: ${endTime - startTime}ms`);
console.log(`自录制开始的累计耗时: ${endTime - startTime}ms`);

Copilot uses AI. Check for mistakes.

---

## 总结
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个相对链接路径不正确:从 docs/recipes/privacy.zh_CN.md 出发,../guide.md 指向的是 docs/guide.md(仓库中不存在)。请改为指向仓库根目录的指南(例如 ../../guide.zh_CN.md,或按期望语言指向 ../../guide.md)。

Copilot uses AI. Check for mistakes.
| blockSelector | null | Use a string to configure which selector should be blocked, refer to the [privacy guide](./docs/recipes/privacy.md) |
| ignoreClass | 'rr-ignore' | Use a string or RegExp to configure which elements should be ignored, refer to the [privacy guide](./docs/recipes/privacy.md) |
| ignoreSelector | null | Use a string to configure which selector should be ignored, refer to the [privacy guide](./docs/recipes/privacy.md) |
| ignoreCSSAttributes | null | array of CSS attributes that should be ignored |
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoreCSSAttributes 在代码中是 Set<string>(见 packages/rrweb/src/types.ts),这里描述成了 “array” 且默认值为 null 容易造成误解。既然本次已经把隐私选项统一指向隐私指南,建议同时把这一行更新为 Set<string>(并可同样加上隐私指南链接以保持一致)。

Suggested change
| ignoreCSSAttributes | null | array of CSS attributes that should be ignored |
| ignoreCSSAttributes | null | Set<string> of CSS attributes that should be ignored, refer to the [privacy guide](./docs/recipes/privacy.md) |

Copilot uses AI. Check for mistakes.
guide.zh_CN.md Outdated
Comment on lines 153 to 154
| ignoreCSSAttributes | null | 应该被忽略的 CSS 属性数组 |
| maskTextClass | 'rr-mask' | 字符串或正则表达式,可用于自定义忽略元素 text 内容的类名,详见[“隐私”](#隐私)章节 |
| maskTextClass | 'rr-mask' | 字符串或正则表达式,可用于自定义忽略元素 text 内容的类名,详见[隐私指南](./docs/recipes/privacy.zh_CN.md) |
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoreCSSAttributes 在实现里是 Set<string>,这里写成“CSS 属性数组”会误导;另外 maskTextClass 是“遮蔽/屏蔽”文本而不是“忽略”。建议将 ignoreCSSAttributes 的描述改为 Set<string>,并把 maskTextClass 的文案从“忽略”改为“遮蔽/屏蔽”。

Copilot uses AI. Check for mistakes.
Comment on lines +995 to +999
]),

// Masking
maskAllInputs: true,
maskInputOptions: {
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoreCSSAttributes is for CSS property names from CSSStyleDeclaration (e.g. color, border-color). This example uses data-* values (data-user-id, etc.), which will never match and is misleading. Replace these with actual CSS properties (or remove this line from the example) and, if you want to recommend excluding DOM attributes, document the appropriate option for that instead.

Copilot uses AI. Check for mistakes.
record({
emit(event) {
const endTime = performance.now();
console.log(`Event processing time: ${endTime - startTime}ms`);
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The timing example measures elapsed time since startTime, not “event processing time” per event. If the intent is to measure handler duration, move startTime inside emit (or rename the log/message to reflect that it is total elapsed time since recording started).

Suggested change
console.log(`Event processing time: ${endTime - startTime}ms`);
console.log(`Elapsed time since recording started: ${endTime - startTime}ms`);

Copilot uses AI. Check for mistakes.

---

## Summary
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This relative link is broken: from docs/recipes/privacy.md, ../guide.md points to docs/guide.md (which doesn’t exist). Update it to the correct path to the repo-root guide (e.g. ../../guide.md).

Copilot uses AI. Check for mistakes.
Comment on lines +993 to +997
]),

// 遮蔽
maskAllInputs: true,
maskInputOptions: {
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignoreCSSAttributes 用于忽略 CSSStyleDeclaration 的 CSS 属性名(例如 colorborder-color)。这里示例里写的是 data-user-id / data-session-id / data-analytics 这类 data-*,不会匹配任何 CSS 属性,容易误导。建议改成真实的 CSS 属性名或移除该行;若想说明忽略 DOM 属性,需要另行说明对应的配置项。

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant