Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Bug]: Download buttons in HTML previews do nothing

已关闭 适合新手
#14,362 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@stickerdaniel 已经在做这个了。

开始于 2026年9月30日。

  • #14363 来自 @stickerdaniel —— 未关闭
  • #16950 来自 @juliusmarminge —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
playwright, typescript
领域
frontend, security

调研方向

从 apps/server/src/http.ts 中的 CSP 开始,找到 BrowserDocumentFrame iframe 的 sandbox 配置。在 Playwright Chromium 中复现 data-URL 下载,然后验证 sandbox 设置允许下载,同时保留现有的限制。HTML 预览的下载按钮能够保存文件,且不会暴露 Cookie、存储或 API,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/server

Steps to reproduce
  1. Have an agent write an HTML file with a download button into the workspace, for example <a href="data:text/plain,hi" download="hi.txt">Download</a>.
  2. Open it from a chat link or the file preview.
  3. Click the button.
Expected behavior

The file downloads.

Actual behavior

Nothing happens, and the page shows no error. HTML assets are served with Content-Security-Policy: sandbox allow-scripts allow-forms allow-popups allow-modals (apps/server/src/http.ts), and BrowserDocumentFrame uses the same list for its iframe sandbox. Chromium drops every download from a sandboxed document unless the sandbox includes allow-downloads.

Adding it keeps the opaque origin, so cookies, storage, and the API stay out of reach.

Impact

Minor bug or occasional failure

Version or commit

main @ 0fcd5f906

Environment

macOS, T3 Code (Nightly) desktop. Also reproduced in Playwright Chromium by serving a page with the same header.

Workaround

Open the file outside T3 Code.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
3 小时 20 分钟
30 天内合并 PR
208

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。