Repository navigation
refactor(screenshot): return the fitted full-page options directly - #990
Conversation
The over-budget branch copied the options, set the clip, then deleted `fullPage` from the copy. Return the object literal with `fullPage: false` instead, the same way the rest of the file turns it off. Puppeteer only rejects a clip when `fullPage` is truthy, so the capture is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
fullPageScreenshotOptscopied the options intofitted, added the clip, then randelete fitted.fullPage.fullPage: false, the same waypackages/screenshot/src/index.jsalready turnsfullPageoff elsewhere. The temporary and thedeleteare gone.options.clip && options.fullPage, sofalsepasses like a missing key, and the returned options go straight intopage.screenshot.Outcome
Same captures, 3 fewer lines in the helper, no
deleteon the options object.Test plan
standard src/index.jsava test/full-page-budget.js test/white-retry.jsinpackages/screenshot: 9 passed, no test edits@browserless/screenshotsuite: left to CI🤖 Generated with Claude Code
Note
Low Risk
Pure refactor of screenshot option shaping with no logic change; existing full-page budget tests pass unchanged.
Overview
Refactors
fullPageScreenshotOptswhen oversized full-page PNGs need a scaled clip: instead of buildingfitted, spreading options, thendelete fitted.fullPage, it returns one object withfullPage: falseset explicitly (matching how full-page is turned off elsewhere in the same file).No intended behavior change—options still include
captureBeyondViewport, the clip scale, andfullPageoff so Puppeteer acceptsclipwithout conflicting withfullPage.Reviewed by Cursor Bugbot for commit edb4c5e. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit