[FEATURE]: Add DevTools for built-in Desktop browser tabs
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- electron, javascript, typescript
- 领域
- desktop-dev, devtools
调研方向
Start with the built-in Desktop browser tab creation and the menu/action registration that currently targets the application shell. Inspect the Browser API observation path and its Electron debugger-detach handling, then run the packaged Desktop app on Windows to reproduce the tab-scoped DevTools workflow. Done means DevTools opens for only the selected tab, preserves its state, and the agent reports busy during manual ownership but recovers after DevTools closes; treat the Browser API follow-ups as separate work.
由索引模型根据 Issue 内容生成。
描述
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Add an Open DevTools action for the active tab in the built-in Desktop browser. This would let me debug the page I am already working on with the agent, preserving its session and in-memory state without reopening it in an external browser or enabling a remote debugging port.
Current behavior (Desktop 2.4.2 on Windows): In the packaged code, the browser tab is created with native DevTools disabled, and View → Toggle Developer Tools targets the application shell. The Browser API already provides page evaluation, console messages, HTTP request inspection, tracing, CPU and heap profiling, and Lighthouse. Related browser-pane work: #63002.
Initial scope: DevTools for a browser tab
Open Chromium's DevTools for the tab selected when the action is invoked. Expose the standard panels available for Electron web content: Elements, Console, Sources, Network, Application, Performance, and Memory, along with Device Mode where supported. The key workflow is stepping through JavaScript in Sources. Keep the same document and page state when opening and closing DevTools.
Electron documents that opening DevTools can detach the existing programmatic debugger. The current browser pane treats an unexpected detach as a page failure. This is an integration risk identified from the packaged code and Electron's documentation, not a failure reproduced with per-tab DevTools enabled. If manual DevTools temporarily takes ownership, agent operations on that tab should report that it is busy, and agent control and diagnostics should recover when DevTools closes.
Acceptance example: Open two pages. On tab A, change an in-memory value, then open DevTools while the agent is already observing the tab. Hit a breakpoint in a test script with a valid TypeScript source map, step, resume, and close DevTools. The value is unchanged and new console and network events from tab A are visible through the Browser API. Tab B is not paused or taken over. Also verify that closing DevTools while tab A is paused does not leave that tab stuck.
Browser API follow-ups
The UI request above can ship independently. The list below tracks additional work for the agent. Where Desktop already has a capability, expose it rather than reimplementing it. Scope agent-controlled breakpoints, emulation, and request overrides to the targeted tab. Support explicit reset and release agent-owned settings when debugging ends or the tab closes.
- JavaScript debugger: set, disable, and remove line breakpoints, conditional breakpoints, and logpoints in plain JavaScript and source-mapped builds. Support pause, step in/over/out, and resume. Inspect sync and async call stacks and local scopes, and evaluate expressions in a paused frame. Include exception, DOM, event-listener and XHR/fetch breakpoints, and worker targets where supported.
- Startup and network control: expose registration and removal of an agent-supplied script that runs before page scripts; Desktop already uses pre-document scripts internally. Add tab-scoped request blocking and request/response overrides for tests (request headers and body; response status, headers, and body), and cache bypass across requests beyond the existing one-off
reload(ignoreCache). - Emulation: expose existing fixed viewport and mobile/touch presets. Add independent controls for device pixel ratio, custom user agent, locale/timezone, geolocation, media preferences, offline and network latency/bandwidth, and CPU throttling.
- Network diagnostics: expose redirect chains already tracked internally, request initiator stacks and timing phases, individual WebSocket messages and SSE events, optional capture across navigation, and HAR export that redacts credential headers and omits URL query strings and payloads by default.
- Application and security diagnostics: cookie inspection and selective cookie clearing are already requested in #63519, which also proposes a basic storage reset. Track the remaining gaps here: blocked-cookie reasons, service-worker inspection and bypass, HTTP-cache behavior, and browser-reported TLS/certificate, mixed-content, CORS and content-policy issues. If existing Desktop site-data/cache clearing is exposed to the agent, show the affected origin or profile and confirm the action. Other tabs can share that data.
- CSS, rendering and coverage: expose matched and overridden rules with source locations, forced pseudo-states, native paint/layout-shift overlays and compositor layers, and used/unused ranges for JS and CSS.
- User-flow recording: record actions a person performs in the tab and export replayable steps.
API acceptance examples:
- On a test page, the agent sets a breakpoint, receives a pause event, reads a known local variable, steps, and resumes. Ending the agent's debugging session while paused releases a pause it owns and preserves user breakpoints.
- Start with the same test endpoint returning
200in two tabs on the same origin. Install a mock before reloading tab A. Make a fresh request from each tab while the mock is active. Tab A receives503; tab B receives200. Remove the mock and verify a new request from tab A receives200.
- 主要语言
- TypeScript
- 星标
- 230k
- 派生
- 31.3k
- 平均合并
- 5 小时 32 分钟
- 30 天内合并 PR
- 453
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
area/desktop platform/macos status/repro-plausible type/bug version/v2
难度 1/5 1-3 小时 新手友好度 88/100
anomalyco/opencode#67064 · 4 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 82/100
anomalyco/opencode#67009 · 2 条评论 ·
维护者通常 1 天内回复
-
area/web type/feature version/v2
难度 2/5 1-3 小时 新手友好度 78/100
anomalyco/opencode#67001 · 3 条评论 ·
维护者通常 1 天内回复
-
skills: a Claude-compatible SKILL.md that fails to parse is dropped without any log可能已有人在做 @liwenjie200543 于 2 天前认领。 未关闭area/plugins platform/linux reproduced type/bug version/v2
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#66970 · 4 条评论 ·
维护者通常 1 天内回复
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaks可能已有人在做 @argszero 于 2 天前认领。 未关闭area/tui platform/wsl status/repro-simulated type/bug version/v2
难度 2/5 1-3 小时 新手友好度 82/100
anomalyco/opencode#66773 · 4 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ci
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/clickhouse-js#1248 ·
维护者通常 1 天内回复
-
E2E: Darlehen-Test wartet auf die gebuchte Auszahlung, bevor er zur Liquiditätsvorschau wechselt未关闭technik
难度 2/5 1-3 小时 新手友好度 78/100
-
bug
难度 2/5 1-3 小时 新手友好度 67/100
SR5-FoundryVTT/SR5-FoundryVTT#2162 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
AhmedNAgy25/analysor#25 ·
维护者通常 1 天内回复