replayBe the first to star Star0

Demos

The real library, running in your browser.

RecordedA small checkout page, in an iframe
Version@voila.dev/replay 0.4.0, built from this repo

Live

The tape, op by op

Click, type, switch tabs. Every change lands on a flat tape, and the copy is rebuilt from it.

Your pagetry it
The copy0.25 s behindHole · waiting for a snapshotRewound
Ops on tape0
Tape, JSON0 B
Tape, gzip0 B

This browser is too old for the recorder (Safari 15.4, Chrome 92, Firefox 90 and later).

A snapshot first, then a drain every 250 ms. Ops are an opcode and its operands: E makes an element, TEXT changes a text, VAL a typed value, MOVE and TAP are the pointer, TICK is time. The copy is a sandboxed iframe without scripts, built through the DOM API, never through the HTML parser.

Masking

In the core, before any module

Type in the card field. What you type never leaves the page.

Your pagetry it
The copy0.25 s behindHole · waiting for a snapshotRewound
Ops on tape0
Tape, JSON0 B
Tape, gzip0 B

This browser is too old for the recorder (Safari 15.4, Chrome 92, Firefox 90 and later).

inputs (default)Typed values become six stars, whatever their length: not even the length leaves. The page's own text stays readable.
textAll text too. Only the layout and the pointer are left.
AlwaysPasswords, card numbers, one-time codes and hidden fields, whatever the mode. Here, the card field is cc-number.

Per element: data-va-mask, data-va-unmask, data-va-block (an empty box of the same size).

Holes

Said, not replayed

Networks lose things. A replay that does not say so shows a page that never existed.

Your pagetry it
The copy0.25 s behindHole · waiting for a snapshotRewound
Ops on tape0
Tape, JSON0 B
Tape, gzip0 B
Holes0

This browser is too old for the recorder (Safari 15.4, Chrome 92, Firefox 90 and later).

Each chunk carries its rank and the number its first node takes. When one is missing, the player marks a hole and waits for the next snapshot, rather than apply changes to nodes it never received. Here the recorder takes a new snapshot 2 s after the loss; in productionconnect asks for one when the server says so.

Seek

From the nearest checkpoint

Seeking back does not replay from the start.

Your pagetry it
The copy0.25 s behindHole · waiting for a snapshotRewound
Ops on tape0
Tape, JSON0 B
Tape, gzip0 B

This browser is too old for the recorder (Safari 15.4, Chrome 92, Firefox 90 and later).

Every 10 s of tape, the player keeps a checkpoint: a copy of the rebuilt page, its node numbers, and what a copy does not carry (constructed sheets, canvas pixels, modal dialogs and popovers, scroll positions, frames). A seek starts from the nearest checkpoint or snapshot before it. Past 64 checkpoints, one in two goes.

Source

What runs on this page
// the recorded page lives in an iframe
const rec = record(frame.contentWindow, { mask, modules: [cssom()] });
const snap = rec.snap();
const player = createPlayer({
  root: stage,
  chunks: [{ base: snap.base, seq: 0, tape: snap.tape }],
});

setInterval(() => {
  const d = rec.drain();
  player.append([{ base: d.base, seq: ++seq, tape: d.tape }]);
  if (!player.playing) player.play();
}, 250);

No server here: chunks go straight from the recorder to the player. In production, connect sends them to your endpoint, gzipped where the browser can, with long strings and snapshot pieces by hash.

Code on GitHub ↗

Recording sessions with rrweb? Tell us what it costs you.