Skip to Content
Pipeline Stages

URL Bar

Show the URL of the page on screen as a pill on the video.

A recording shows no browser chrome. .urlBar() shows the URL of the page on screen, protocol included, as a pill at the bottom of the frame.

await Recast
  .from('./traces')
  .parse()
  .urlBar({ redact: [/acme-\d+/g] })
  .render()
  .toFile('demo.mp4')

URLs come from the trace's DOM snapshots (trace: 'on'), which include hash routes like #/workspaces/42 and leave out iframes. A trace without snapshots falls back to goto() targets, resolved against the context's baseURL. about: pages and credentials in a URL (user:pass@) are never shown.

When it shows

show
'host-change' (default)When the page on screen moves to another host, for durationMs. The host at the first visible frame is the starting point and shows no bar. Hosts seen only inside hidden steps do not count.
'always'The whole video, following every URL change
'marked'At each showUrl() call, for durationMs

Across pages, the URL follows the page on screen: a popup on another host shows its own URL.

Options

OptionTypeDefaultDescription
show'host-change' | 'always' | 'marked''host-change'When the bar shows
durationMsnumber3000How long it stays, in output ms (host-change, marked)
stripQuerybooleantrueDrop the query string, also inside a hash route, and a fragment that is not a route (#/..., #!/...), such as OAuth's #access_token=...
rewriteArray<{ match: string | RegExp; with: string }>[]Replacements applied in order, each to the previous result, after stripQuery and before redact. Strings match literally, every occurrence (an empty one is skipped); a RegExp replaces like String.replace() ($1 in with, every match only with g).
redactArray<string | RegExp>[]Parts to mask. Strings match literally; give a RegExp the g flag to mask every match.
redactWithstring'***'Replacement for redacted parts
position'bottom' | 'top''bottom'Edge of the frame
fontSizenumber28Text size at 1080p, scaled with the output
fontFilestringfontconfig defaultFont file for the text
colorstring'#FFFFFF'Text color
backgroundstring'#1F2328'Pill color
backgroundOpacitynumber0.8Pill opacity
  • Drawn on the output frame after zoom, so zooming leaves it alone. Burned-in subtitles draw on top; with subtitles at the bottom, use position: 'top'.
  • Page-level blur does not reach the bar: mask account names, IDs and tokens with redact.
  • Show a production-looking address instead of a local test server's, one rule per origin:
.urlBar({
  rewrite: [
    { match: 'http://127.0.0.1:8110', with: 'https://app.example.com' },
    { match: /^http:\/\/127\.0\.0\.1:\d+/, with: 'https://devops.example.com' },
  ],
})
  • Needs ffmpeg's drawtext (libfreetype) and a font (fontconfig or fontFile); the render stops with an error otherwise.
  • Not with direct() yet: it crops the rendered video and would zoom the bar.

On this page