跳到正文
DEV Community· alapha888·· 6 天前AI 評分48

ConvoExport 以真實分享對話測試 ChatGPT 匯出擴充功能,揭示 30 秒 hydration 陷阱

Testing a ChatGPT export extension against real shared conversations — and the 30-second hydration trap

AI 導讀

ConvoExport 的內容指令碼在兩個 ChatGPT 公開分享頁均通過端到端測試,完整讀取對話並正確交替標示角色。頁面載入後立即讀取會把所有回合標成用戶,等待約 30 秒再讀取即可修正。

正文

alapha888

I built ConvoExport, a small local-first browser extension that exports a single ChatGPT or Claude conversation to Markdown. Before submitting it to a store, I wanted to test the content script against real pages, not fixtures. Public ChatGPT share links turned out to be a usable stand-in: they render with the same DOM as the logged-in conversation view.

The setup was headless Chrome 154 with a local CONNECT relay, loading the packaged extension, pinging the content script, then sending the read-conversation message and checking the Markdown the extension built.

Two out of two share pages passed end to end:

  • "AI safety", 14 turns, 6,264 bytes of Markdown
  • "Oil A25A-FKS", 5 turns, 30,636 bytes — assistant turns of 8k-11k words came through complete, roles alternating correctly

The trap was timing. Reading the page immediately after load labeled every turn as the user. The page had not finished hydrating yet. Waiting about 30 seconds and re-reading fixed the roles. If your extension reads a React-rendered page, do not trust the first read — wait for hydration, or read twice.

The honest limits: Claude share pages were blocked both times by a Cloudflare challenge in this environment (a datacenter IP problem, not an extension problem). The content script ping worked, but the Claude adapter has only fixture tests behind it so far. DeepSeek share pages hit CloudFront 403 twice for the same reason. Those adapters stay unproven against the real DOM until I can test from a residential IP or a logged-in session.

ConvoExport is currently in review on Edge Add-ons. Its privacy page is at https://alapha888.github.io/convo-export-privacy/ — the extension runs fully locally and sends nothing anywhere.

The takeaway is boring and worth repeating: fixture tests passed from day one and proved nothing about the real page. The two real-page runs caught a timing bug no fixture could have shown.

來源:DEV Community · dev.to