You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session Replay: Add support for multiple window setups #390
The current session replay window detection logic has limitations when handling transparent (or passthrough) overlay windows, leading to incomplete or inaccurate screen captures and masking in certain use cases.
Current Implementation
Session replay uses [UIApplication.getCurrentWindow()](https://github.com/PostHog/posthog-ios/blob/b71b7b1ba861391377d01251479530b938881ce0/PostHog/Replay/PostHogReplayIntegration.swift#L237) which returns the top-most key window:
This approach does not explicitly handle cases where a custom overlay or passthrough window is added to the app. This technique is often used to manage and display app-wide notifications/toasts, bottom-sheets, modal alerts etc
Proposed Solution
Implement window stack detection that:
Discover all windows between the top transparent window down to the first opaque window
Filters system windows like UITextEffectsWindow
Capture a composite of UIWindow snapshots (+ masking) bottom-up this time around
Priority
There's a limited user report which suggests this isn't widely affecting users. Since the implementation will have wide implications on the current session replay implementation (for example there are some system window overlays like UITextEffectsWindow that should be ignored), I'm opening this issue to collect interest before before moving with a any implementation effort
Activity