Browser: 'Add Area Screenshot to Chat' and 'Add Full Page Screenshot to Chat (Experimental)'#318791
Merged
Merged
Conversation
…es/2026.05-area-full-screenshot
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new Integrated Browser "Add to Chat" screenshot flows for selected areas and experimental full-page capture, extending the browser view service/model, preload picker UI, and workbench chat actions.
Changes:
- Adds browser view API/state/events for area selection and full-page screenshot options.
- Implements main-process area selection routing and CDP-based full-page screenshot capture.
- Adds workbench menu actions, context keys, telemetry, and configuration gating for new screenshot tools.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/browserView/electron-browser/features/browserEditorChatFeatures.ts |
Adds chat attachment helpers, area/full-page screenshot actions, menu grouping, telemetry, and experimental setting. |
src/vs/workbench/contrib/browserView/common/browserView.ts |
Mirrors new area-selection state, events, and service calls on the workbench model. |
src/vs/platform/browserView/electron-main/browserViewMainService.ts |
Exposes new area-selection service methods/events through the main service. |
src/vs/platform/browserView/electron-main/browserViewInspector.ts |
Adds top-frame area picker lifecycle and IPC handling. |
src/vs/platform/browserView/electron-main/browserView.ts |
Adds area-selection state and full-page screenshot capture support. |
src/vs/platform/browserView/electron-browser/preload-browserView.ts |
Adds preload-side drag-to-select area picker overlay. |
src/vs/platform/browserView/common/browserView.ts |
Adds command IDs, shared rectangle type, full-page screenshot option, and area-selection service API. |
Copilot's findings
- Files reviewed: 7/7 changed files
- Comments generated: 2
Comment on lines
+656
to
+670
| const result = await this.debugger.sendCommand('Page.captureScreenshot', { | ||
| format: 'jpeg', | ||
| quality, | ||
| captureBeyondViewport: true, | ||
| // In theory, `clip` defaults to the full area when not explicitly passed, but in practice it doesn't work when | ||
| // the zoom level isn't 100, because it doesn't multiply the width and height by zoomFactor like we do here. | ||
| // Setting the clip explicitly, we can multiply by zoomFactor and thus work around this Chromium bug. | ||
| // Note that even with this workaround, we often see that the page isn't fully captured and might repeat | ||
| // visual content from the top at the bottom, instead of showing the bottom of the page. | ||
| // - Sidenote: Setting the scale here to be zoomFactor or 1/zoomFactor has strange effects and doesn't solve the issue. | ||
| // - Another sidenote: Currently the scrollbar width isn't accounted for. If a scrollbar exists, we should add the | ||
| // vertical scrollbar's width and horizontal scrollbar's height to the clip dimensions, since the image is currently | ||
| // clipped by that amount (this also happens when no clip parameter is provided; ideally it should be fixed upstream | ||
| // in Chromium). | ||
| clip: { x: 0, y: 0, width: size.width * zoomFactor, height: size.height * zoomFactor, scale: 1 } |
DonJayamanne
approved these changes
May 29, 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.
New feature: 'Add Area Screenshot to Chat'
area.mp4
New feature: 'Add Full Page Screenshot to Chat (Experimental)'
full-page.mp4
clipparameter that adjusts for the zoom level.