brawsrdocsv0.6
Examples

Examples

Learn checkpoint, rewind, and fork through small browser-automation stories.

The examples start with a situation your automation can actually encounter: a bad step you want to discard, several independent paths that need the same prepared browser, or two routes you want to evaluate without rebuilding state.

Each page explains the state transition first and shows only the code that drives it. The complete runnable programs live in brawsr/examples (opens in a new tab).

Recover from a bad step

Prepare a page, capture it, make a change, then return to the captured state. The TypeScript and Python stories also show why a rewind requires a fresh Playwright connection.

Start several paths from one state

Checkpoint a prepared browser once, then create isolated child sessions that all inherit that state. Use a regular fork when you need every branch; use speculative branching when your application will evaluate alternatives and select one.

The recovery boundary still applies

Browser state can be restored or branched. An effect already accepted by a website, payment processor, or another external system cannot be undone by rewind.

On this page