TabbyML / tabby

Self-hosted AI coding assistant
https://tabby.tabbyml.com/
Other
18.28k stars 771 forks source link

fix(ui): disable posthog inside iframe #2534

Closed wwayne closed 5 days ago

wwayne commented 5 days ago

Issue

When loading the site inside iFrame with postHogProvider, the iframe page is empty

Why

PostHogProvider from posthog-js/react makes the bug, but not sure about the root reason at the moment.

PostHog has official doc about Iframe recording, it says If the iframe is from the same domain as the main page, there is no special setup needed.. I didn't find we have setting up any restriction like Content-Security-Policy, so not sure what we can fix with PostHogProvider.

Fix

Disable PostHogProvider inside iFrame now when user opening Ask Tabby inside code browser, the event on PostHog dashboard is:

Screenshot 2024-06-28 08 03 21