getsentry / getsentry/sentry-javascript

Capture Document Picture-in-Picture windows in Replay

Aperta
#23,825 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Browser Replays
Lingua principale
TypeScript
Stelle
8.7k
Fork
1.8k
Merge medio
1g 17h
PR unite (30g)
515

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
frontend, observability
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Da chiarire
Idoneità per principianti
32/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.