getsentry / getsentry/sentry-javascript

Capture Document Picture-in-Picture windows in Replay

Abierto
#23,825 1 comentario 0 reacciones 0 asignados Ver en GitHub
Browser Replays
Lenguaje dominante
TypeScript
Estrellas
8.7k
Forks
1.8k
Merge medio
1 d 17 h
PR fusionados (30 d)
515

Descripción

We have a use case where a modal is shown in Document Picture-in-Picture mode. That opens a separate window where the modal UI is rendered. With Sentry we can capture network requests, logs, errors, and related telemetry from that PiP window, but Session Replay does not capture the PiP window itself, so the modal UI is missing from the replay.

### Current behavior
- Replay/rrweb attaches to the opener document.
- A Document PiP window is a separate same-origin `Window`/`document` created via `documentPictureInPicture.requestWindow()` ([MDN](https://developer.mozilla.org/en-US/docs/Web/API/Document_Picture-in-Picture_API)).
- The SDK does not hook `documentPictureInPicture` / `requestWindow`, and only one `replayIntegration()` instance is supported per page.
- Manual `start()` / `stop()` / `flush()` and canvas `snapshot()` / `addWindow` do not record PiP DOM into Session Replay playback.
- Related multi-document work is iframe-scoped only (e.g. `_experiments.recordCrossOriginIframes`, #7279, #14008, #14809, #16173, discussion #11858).

### Gap
- Product UI hosted in Document PiP is missing from replays, even when other Sentry signals from that window are present.
- Native `` PiP is browser chrome (not app DOM) and is a different surface; media is also typically blocked by default privacy settings.

### Impact
- Debugging and support workflows break when the relevant UI only exists in the PiP window.
- Customers cannot recover that visual context with current Replay APIs or config.

Requested by **david.quintas**.

--

[View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B7D5XDYCD%3A1788257480.804779) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B7D5XDYCD%3A1788257480.804779/?project=4510944073809921)

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start at replayIntegration and the rrweb document attachment described in the issue, then trace how documentPictureInPicture.requestWindow() creates the separate same-origin document. Compare this with the existing iframe-scoped multi-document work and the single-instance constraint. Done means the PiP modal DOM appears in Session Replay playback without relying on manual start, stop, flush, snapshot, or addWindow calls.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
frontend, observability
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Activo
Claridad
Necesita aclaración
Aptitud para principiantes
32/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.