Fix "add element to chat" while debugging#305831
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes the Integrated Browser “Add Element to Chat” flow when JavaScript execution is paused in DevTools (debug mode) by ensuring the CDP domains needed for selection are enabled before a pause can cause CDP commands (notably CSS.enable) to hang.
Changes:
- Refactors element inspection into a
BrowserViewElementInspectorthat keeps a persistent CDP session and pre-enablesDOM,Overlay, andCSS. - Updates
BrowserViewto own/reuse the inspector instance and delegate element selection/focused-element retrieval to it.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/vs/platform/browserView/electron-main/browserViewElementInspector.ts | Introduces a persistent inspector class that pre-initializes CDP domains and reworks selection/focused-element flows to reuse the same session. |
| src/vs/platform/browserView/electron-main/browserView.ts | Wires the new inspector into BrowserView and removes direct calls to the previous helper functions. |
src/vs/platform/browserView/electron-main/browserViewElementInspector.ts
Outdated
Show resolved
Hide resolved
…spector.ts Co-authored-by: Copilot <[email protected]>
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @jrualesMatched files:
|
pwang347
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #299777