From 31487f7237d0850184612aeea1e5204976ce362f Mon Sep 17 00:00:00 2001 From: Kevin Steven Caluser Date: Wed, 22 May 2024 07:44:33 +0200 Subject: [PATCH] Fix Viewport resizing upon page.screenshot --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index a80671a..ddd88da 100644 --- a/index.js +++ b/index.js @@ -32,6 +32,7 @@ const batteryStore = {}; `--lang=${config.language}`, config.ignoreCertificateErrors && "--ignore-certificate-errors" ].filter((x) => x), + defaultViewport: null, timeout: config.browserLaunchTimeout, headless: config.debug !== true }); @@ -280,6 +281,7 @@ async function renderUrlToImageAsync(browser, pageConfig, url, path) { await page.screenshot({ path, type: pageConfig.imageFormat, + captureBeyondViewport: false, clip: { x: 0, y: 0,