getsentry / getsentry/sentry-javascript
Capture Document Picture-in-Picture windows in Replay
- Langage dominant
- TypeScript
- Étoiles
- 8.7k
- Forks
- 1.8k
- Merge moyen
- 1 j 17 h
- PR mergées (30 j)
- 523
Description
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)
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- frontend, observability
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- Active
- Clarté
- À clarifier
- Accessibilité débutants
- 32/100