Skip to content

Commit

Permalink
add captureBeyondViewport flag for Puppeteer
Browse files Browse the repository at this point in the history
Since v5.3.7 Puppeteer does not capture beyond viewport anymore, which could cause some issues for people relying on it.
A new flag `captureBeyondViewport` for toggling that setting is introduced in engineOptions as discussed in #1344.
  • Loading branch information
saitho committed Nov 12, 2021
1 parent 6a30f1f commit e3a80e2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions core/util/runPuppet.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,10 @@ async function captureScreenshot (page, browser, selector, selectorMap, config,
}

const type = config.puppeteerOffscreenCaptureFix ? page : el;
const params = config.puppeteerOffscreenCaptureFix
? {
captureBeyondViewport: false,
path: path,
clip: box
}
: { captureBeyondViewport: false, path: path };
const params = { captureBeyondViewport: config.captureBeyondViewport ?? false, path: path };
if (config.puppeteerOffscreenCaptureFix) {
params.clip = box;
}

await type.screenshot(params);
} else {
Expand Down

0 comments on commit e3a80e2

Please sign in to comment.