Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 684 Bytes

canvas.md

File metadata and controls

35 lines (27 loc) · 684 Bytes

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:

rrweb.record({
  emit(event) {},
  recordCanvas: true,
});

Alternatively enable image snapshot recording of Canvas at a maximum of 15 frames per second:

rrweb.record({
  emit(event) {},
  recordCanvas: true,
  sampling: {
    canvas: 15,
  },
});

Enable replaying Canvas:

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.