OpenAI Codex 的 in-app browser 适合预览本地开发页面、文件预览和无需登录的公开页面,并直接在页面上给 Codex 留视觉评论。遇到登录态、浏览器扩展、cookies、已打开标签页或认证流程时,需要改用常规浏览器或 Codex Chrome extension;可通过工具栏、URL、手动导航,或按 Cmd+Shift+B(Windows 为 Ctrl+Shift+B)打开。
OpenAI Codex 站内浏览器怎么用
OpenAI Codex 的 in-app browser 让你和 Codex 在同一个线程里看见同一份网页渲染结果,适合前端联调、页面预览和基于视觉反馈的修改。
它更适合本地开发服务器、文件预览页和不需要登录的公开页面;如果页面依赖登录状态或浏览器扩展,请改用常规浏览器或 Codex Chrome extension。
怎么打开站内浏览器
你可以通过以下方式打开 in-app browser:
- 从工具栏打开
- 点击一个 URL
- 在浏览器里手动跳转
- 按 Cmd+Shift+B(Windows 上是 Ctrl+Shift+B)
Browser use
Browser use 允许 Codex 直接操作 in-app browser。它适合本地开发服务器和文件预览场景,尤其是 Codex 需要执行这些操作时:
- 点击页面元素
- 输入文本
- 检查渲染后的页面状态
- 截图
- 下载页面资源
- 运行只读的页面检查 JavaScript
- 在页面里验证修复结果
要使用它,先安装并启用 Browser plugin。然后在任务里明确让 Codex 使用 browser,或者直接用 @Browser 引用它。应用会把 browser use 限制在 in-app browser 中,并且可以在设置里管理允许和阻止的网站。
示例:
Use the browser to open http://localhost:3000/settings, reproduce the layout
bug, and fix only the overflowing controls.
默认情况下,Codex 会在使用网站前先询问,除非你已经允许该网站。
- 从 allowed list 中移除网站后,Codex 会在下次使用前再次询问
- 从 blocked list 中移除网站后,Codex 可以再次询问,而不是继续把它当成已阻止站点
如果是 Chrome 里的已登录网站,请看 Codex Chrome extension。
预览页面
- 在 integrated terminal 里,或者通过 local environment action 启动应用的开发服务器。
- 通过点击 URL,或在浏览器里手动导航,打开未认证的本地路由、文件预览页或公开页面。
- 对照代码 diff 检查页面渲染结果。
- 在需要修改的元素或区域上留下 browser comments。
- 让 Codex 处理这些评论,并保持修改范围尽量小。
示例反馈:
I left comments on the pricing page in the in-app browser. Address the mobile
layout issues and keep the card structure unchanged.
怎么在页面上留言
当问题只在渲染后的页面里可见时,用 browser comments 给 Codex 精确反馈。
- 打开 Annotation mode,选中一个元素或区域,然后提交 comment。
- 在 Annotation mode 下,按住 Shift 再点击,可以选择一个区域。
- 按住 Cmd 再点击,可以立即发送 comment。
留下评论后,在线程里发消息,让 Codex 处理这些评论。只有当你需要它做精确的视觉修改时,comments 才最有用。
好的反馈要具体:
This button overflows on mobile. Keep the label on one line if it fits,
otherwise wrap it without changing the card height.
This tooltip covers the data point under the cursor. Reposition the tooltip so
it stays inside the chart bounds.
Styling feedback
在页面某个区域添加 annotation 后,点击文本输入框旁边的 config icon,可以给 Codex 更细粒度的样式反馈。你可以直接在页面上预览修改效果,并提交 annotation,让 Codex 更明确地知道要改哪些样式。
可调整的值包括 font、text、spacing 和 color。
保持 browser 任务范围足够小
in-app browser 适合 review 和 iteration。每个 browser task 都要小到能一次看完结果。
- 指定页面、路由或本地 URL
- 指定你关心的视觉状态,例如 loading、empty、error 或 success
- 在需要修改的精确元素或区域上留言
- Codex 改完代码后,回到更新后的 route 再检查一次
- 让 Codex 在使用 browser 前先启动或检查开发服务器
如果是仓库变更,使用 review pane 检查变更并留下评论。
常见问题
OpenAI Codex 的站内浏览器能打开登录后的页面吗?
不能。in-app browser 不支持 authentication flows、signed-in pages、你的常规浏览器 profile、cookies、extensions 或已有标签页。需要登录态的页面请改用常规浏览器或 Codex Chrome extension。
OpenAI Codex 怎么打开站内浏览器?
可以从工具栏打开,也可以点击 URL、手动导航,或者按 Cmd+Shift+B;Windows 上对应 Ctrl+Shift+B。
Codex 浏览器评论什么时候最有用?
当 bug 只在渲染后的页面里能看到时最有用,尤其是布局溢出、tooltip 遮挡、对齐偏差这类需要精确视觉修改的问题。评论越具体,Codex 越容易只改你要的区域。