From 1f4e4b3a035ee02c5483ae597c269720d99e17a0 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Thu, 2 Aug 2018 20:41:53 -0700 Subject: [PATCH] Fix weird offset bug in screenshots --- experiments/automatedScreenshots/shooter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/experiments/automatedScreenshots/shooter.js b/experiments/automatedScreenshots/shooter.js index 4c71146e..2823c06e 100644 --- a/experiments/automatedScreenshots/shooter.js +++ b/experiments/automatedScreenshots/shooter.js @@ -68,7 +68,9 @@ class Shooter { }); await this._page.screenshot({ path: screenshotPath, - omitBackground: true // Make screenshot transparent + omitBackground: true, // Make screenshot transparent + // https://github.com/GoogleChrome/puppeteer/issues/703#issuecomment-366041479 + clip: { x: 0, y: 0, width: 275, height: 116 * 3 } }); console.log("Wrote screenshot to", screenshotPath); if (minify) {