The Angular service worker (ngsw) intercepts all calls and seems to break session recordings. The only way to bypass the service worker is by adding ngsw-bypass as either a query param or a header to every request to posthog. As far as I can tell it's not possible in posthog to configure "global" query params, so the only way left is adding headers, which is possible with xhr_headers as described here: https://posthog.com/docs/libraries/js
However unfortunately this is not allowed by posthog... Could you allow this specific header? Or is there any other way to fix this issue?
Access to XMLHttpRequest at 'https://eu.posthog.com/e/?ip=1&_=1234&ver=1.57.2' from origin 'http://localhost:4200' has been blocked by CORS policy: Request header field ngsw-bypass is not allowed by Access-Control-Allow-Headers in preflight response.
The Angular service worker (ngsw) intercepts all calls and seems to break session recordings. The only way to bypass the service worker is by adding
ngsw-bypass
as either a query param or a header to every request to posthog. As far as I can tell it's not possible in posthog to configure "global" query params, so the only way left is adding headers, which is possible withxhr_headers
as described here: https://posthog.com/docs/libraries/jsHowever unfortunately this is not allowed by posthog... Could you allow this specific header? Or is there any other way to fix this issue?