diff --git a/apps/readest-app/package.json b/apps/readest-app/package.json index 23dcc26b..abda1948 100644 --- a/apps/readest-app/package.json +++ b/apps/readest-app/package.json @@ -28,6 +28,7 @@ "foliate-js": "workspace:*", "js-md5": "^0.8.3", "next": "15.0.1", + "posthog-js": "^1.180.1", "react": "18.3.1", "react-dom": "18.3.1", "react-icons": "^5.3.0", diff --git a/apps/readest-app/src-tauri/tauri.conf.json b/apps/readest-app/src-tauri/tauri.conf.json index 3689ab3f..34177b79 100644 --- a/apps/readest-app/src-tauri/tauri.conf.json +++ b/apps/readest-app/src-tauri/tauri.conf.json @@ -26,10 +26,11 @@ ], "security": { "csp": { - "default-src": "'self' 'unsafe-inline' blob: customprotocol: asset: http://asset.localhost ipc: http://ipc.localhost", + "default-src": "'self' 'unsafe-inline' blob: customprotocol: asset: http://asset.localhost ipc: http://ipc.localhost https://*.sentry.io https://*.posthog.com", "img-src": "'self' blob: data: asset: http://asset.localhost", "style-src": "'self' 'unsafe-inline' blob: asset: http://asset.localhost", - "frame-src": "'self' blob: asset: http://asset.localhost" + "frame-src": "'self' blob: asset: http://asset.localhost", + "script-src": "'self' 'unsafe-inline' 'unsafe-eval' blob: asset: http://asset.localhost https://*.sentry.io https://*.posthog.com" }, "assetProtocol": { "enable": true, diff --git a/apps/readest-app/src/app/layout.tsx b/apps/readest-app/src/app/layout.tsx index e6a0c7b3..5d70a2e8 100644 --- a/apps/readest-app/src/app/layout.tsx +++ b/apps/readest-app/src/app/layout.tsx @@ -2,6 +2,7 @@ import * as React from 'react'; import type { Metadata } from 'next'; import { AuthProvider } from '@/context/AuthContext'; import { EnvProvider } from '@/context/EnvContext'; +import { CSPostHogProvider } from '@/context/PHContext'; import './globals.css'; export const metadata: Metadata = { @@ -15,11 +16,13 @@ export default function RootLayout({ children }: { children: React.ReactNode })
- -