Latest Results
feat(web): count page views and runs on the hosted site with PostHog
The hosted site now counts how often the printer is used. On
long-screen.yi-ting.com and long-screen.pages.dev, without Do Not Track or
Global Privacy Control, main.js adds assets/analytics.js (src/analytics.ts),
which bundles PostHog's slim no-external SDK (posthog-js 1.438.12) and sends a
page view plus run_started and run_finished events queued by
src/ui/analytics.ts. Events carry settings, the core version, the codec
family, a frame-count bucket, elapsed seconds, the canvas count and diagnostic
codes; never a file name, pixels or message text. A stopped run ends as
`stopped`, a failed start as `start_failed`, and a run the browser killed is
reported as `interrupted` on the next load.
The SDK is bundled rather than loaded from PostHog's CDN because the page is
cross-origin isolated and PostHog's scripts send no
Cross-Origin-Resource-Policy header. Cookieless mode with in-memory
persistence keeps nothing in the browser, `advanced_disable_flags` skips the
remote config so the dashboard cannot switch on replay or surveys, and the CSP
gains https://us.i.posthog.com in connect-src only. Self-hosted copies, local
development and the portable build never load the SDK, and main.js has no
dynamic import(), which the portable build refuses.
The help page's privacy section (zh and en, static/index.html byte-identical
to the zh catalogue), the README and AGENTS.md say what is counted and by
whom. tests/browser/analytics.test.ts runs the demo and a stopped run in
Chrome and WebKit under the deployed CSP, checks the exact events and that no
payload, cookie or storage key identifies the user, and that a GPC page never
fetches the SDK; LONGSCREEN_ANALYTICS_LIVE=1 sends to the real project. Latest Branches
0%
fix/open-defects-20261025 0%
×2.3
© 2026 CodSpeed Technology