Use blob object URL for browser editor placeholder screenshot#318473
Merged
Conversation
Replaces base64 data URL with a Blob + URL.createObjectURL so the JPEG screenshot bytes are not simultaneously retained as a VSBuffer, a ~1.33x base64 JS string, and a parsed CSS data URL. The object URL is revoked when the screenshot is replaced or the editor is disposed.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces memory overhead in the integrated browser editor (desktop/electron) by switching the placeholder screenshot from a base64 data: URL (stored in JS/CSS strings) to a Blob-backed blob: object URL, and ensuring the URL is revoked when replaced or when the editor is torn down.
Changes:
- Replace base64 encoding of screenshot buffers with
Blob+URL.createObjectURL. - Track and revoke the active object URL on screenshot replacement,
clearInput, anddispose.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/browserView/electron-browser/browserEditor.ts | Use blob: object URLs for placeholder screenshot background images and revoke them to prevent memory retention. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
jruales
approved these changes
May 27, 2026
jruales
pushed a commit
that referenced
this pull request
May 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.
The integrated browser editor's placeholder screenshot was set via a base64 data URL on
style.backgroundImage. For every visible browser tab this kept the JPEG bytes alive three times: as aVSBuffer, as a ~1.33x base64 JS string, and as the parsed CSS data URL value.This change builds a
Blobfrom theVSBufferand usesURL.createObjectURLinstead. The object URL is revoked when the screenshot is replaced or the editor is disposed.Motivated by heap snapshots showing duplicate retention of screenshot image data.