Skip to content

Fix "add element to chat" while debugging#305831

Merged
kycutler merged 2 commits intomainfrom
kycutler/addelementdebugging
Mar 27, 2026
Merged

Fix "add element to chat" while debugging#305831
kycutler merged 2 commits intomainfrom
kycutler/addelementdebugging

Conversation

@kycutler
Copy link
Copy Markdown
Contributor

Fixes #299777

Copilot AI review requested due to automatic review settings March 27, 2026 21:35
@kycutler kycutler self-assigned this Mar 27, 2026
@vs-code-engineering vs-code-engineering bot added this to the Backlog milestone Mar 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 BrowserViewElementInspector that keeps a persistent CDP session and pre-enables DOM, Overlay, and CSS.
  • Updates BrowserView to 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.

@kycutler kycutler marked this pull request as ready for review March 27, 2026 22:06
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering bot commented Mar 27, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jruales

Matched files:

  • src/vs/platform/browserView/electron-main/browserView.ts
  • src/vs/platform/browserView/electron-main/browserViewElementInspector.ts

@kycutler kycutler enabled auto-merge (squash) March 27, 2026 22:21
@kycutler kycutler merged commit fe491c0 into main Mar 27, 2026
18 checks passed
@kycutler kycutler deleted the kycutler/addelementdebugging branch March 27, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integrated browser add element to chat does not work in debug mode

3 participants