Files
rrweb/docs/recipes/canvas.md
Yanzhen Yu aeeafddb46 update docs
2026-04-01 12:00:00 +08:00

24 lines
482 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Canvas
Canvas is a special HTML element, which will not be recorded by rrweb by default. There are some options for recording and replaying Canvas.
Enable recording Canvas
```js
rrweb.record({
emit(event) {},
recordCanvas: true,
});
```
Enable replaying Canvas
```js
const replayer = new rrweb.Replayer(events, {
UNSAFE_replayCanvas: true,
});
replayer.play();
```
**Enable replaying Canvas will remove the sandbox, which may cause a potential security issue.**