Repository navigation
Conversation
nattallius
reviewed
Nov 13, 2026
nattallius
left a comment
Contributor
There was a problem hiding this comment.
Lgtm, @OrKoN What do you think on this change? Does it follow the correct direction?
| } | ||
|
|
||
| if (options.backgroundColor || this.emulationSettings.backgroundColor) { | ||
| if (!secondarySession) { |
Contributor
There was a problem hiding this comment.
This check runs after network, CPU, user agent and media features are already applied to the browser, but before this.emulationSettings is updated. If it throws, the browser state and the stored settings diverge. Can we validate the session at the start of emulate(), before any side effects?
OrKoN
self-requested a review
November 14, 2026 08:31
OrKoN
reviewed
Nov 16, 2026
| positional: false, | ||
| }, | ||
| backgroundColor: { | ||
| name: 'backgroundColor', |
Collaborator
There was a problem hiding this comment.
would supporting omitBackground on screenshots also solve the issue? https://pptr.dev/next/api/puppeteer.screenshotoptions#omitbackground
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.
Adds
backgroundColortoemulate, following the direction in #806. Callers can specify#RRGGBBor#RRGGBBAAto choose the default backdrop for transparent page content, including fully transparent PNG screenshots. Explicit CSS backgrounds retain their colors.The override belongs to the target page, persists across navigation, and participates in emulation restoration. Omitting it from a subsequent
emulatecall clears it, consistent with the existing replacement semantics. Responses report the active background color in both text and structured content. The generated CLI option, tool reference, metrics metadata, and tool-selection guidance are updated.Refs #806.
Validation: generation, formatting checks, and focused tests pass. The full suite has one existing failure,
with full page resulting in a large screenshot(Page is too large), reproduced with the same focused command on unchanged main at44e06b1.