Network recording when recording cross origin iframes
Author: pauldambraCreated Jul 7, 2025Updated Sep 30, 2026
Labelsbugfeature/replay
Bug Description
When recording cross origin iframes the instance of session replay in the iframe posts messages to the parent window, instead of sending them via API to the backend
A user has set sandbox values on the iframe and reports they see
record.js:5536 DataCloneError: Failed to execute 'postMessage' on 'Window': PerformanceServerTiming object could not be cloned.
at At (record.js:4809:14)
at callback (record.js:5520:32)
at o (network-plugin.ts:660:13)
at mn (network-plugin.ts:72:9)
at Object.Tn [as observer] (network-plugin.ts:663:33)
at at (record.js:3606:5)
at P (record.js:5411:3)
at ct.loadListener (record.js:5534:12)
at ct.attachIframe (record.js:3753:18)
at onIframeLoad (record.js:5379:1)
at HTMLIFrameElement.<anonymous> (record.js:1241:13)so PerformanceServerTiming can be serialized to send over the wire but not cloned for postmessage
we should make sure that we're recording an object that we create and not the window's PerformanceServerTiming object
Debug info
- [ ] PostHog Cloud, Debug information: [please copy/paste from https://us.posthog.com/settings/project-details#variables or https://eu.posthog.com/settings/project-details#variables]
- [ ] PostHog Hobby self-hosted with `docker compose`, version/commit: [please provide]
- [ ] PostHog self-hosted with Kubernetes (deprecated, see [`Sunsetting Kubernetes support`](https://posthog.com/blog/sunsetting-helm-support-posthog)), version/commit: [please provide]Source: PostHog/posthog