Skip to content

Commit 96a6369

Browse files
authored
Document replay iframe embedding (#511)
* Document replay iframe embedding * Specify replay iframe CSP --------- Co-authored-by: rgarcia <72655+rgarcia@users.noreply.github.com>
1 parent 75c9406 commit 96a6369

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

browsers/replays.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,30 @@ func main() {
237237
}
238238
```
239239
</CodeGroup>
240+
241+
## Embedding a replay
242+
243+
Set an iframe's `src` to the `replay_view_url` returned when you start or list a replay. Give the iframe an explicit aspect ratio so the player keeps its shape while loading, and enable fullscreen playback. Merge the example's `frame-src` sources into your existing Content Security Policy.
244+
245+
Replace `REPLAY_VIEW_URL` with the URL returned by the API:
246+
247+
```html
248+
<meta
249+
http-equiv="Content-Security-Policy"
250+
content="frame-src https://*.kernel.sh:8443 https://*.onkernel.com:8443 https://kernel-api-prod.s3.us-east-1.amazonaws.com;"
251+
>
252+
253+
<div style="width: 100%; aspect-ratio: 16 / 10;">
254+
<iframe
255+
src="REPLAY_VIEW_URL"
256+
title="Browser session replay"
257+
loading="lazy"
258+
referrerpolicy="no-referrer"
259+
allow="fullscreen"
260+
allowfullscreen
261+
style="display: block; width: 100%; height: 100%; border: 0;"
262+
></iframe>
263+
</div>
264+
```
265+
266+
Use the recorded browser's viewport ratio if it differs from `16 / 10`. Treat replay URLs as sensitive.

0 commit comments

Comments
 (0)