From 73387fd914912cbf9f214c7e19e764c9f070eebc Mon Sep 17 00:00:00 2001 From: Stephen Ash Date: Thu, 2 Nov 2017 10:05:43 -0700 Subject: [PATCH] fix(Launcher): skip --disable-gpu flag on linux and mac platforms Disabling GPU is no longer necessary on these platforms given the Chromium version installed by puppeteer. --- lib/Launcher.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Launcher.js b/lib/Launcher.js index dda4c5235fae8..f2d8a00e3c1eb 100644 --- a/lib/Launcher.js +++ b/lib/Launcher.js @@ -81,10 +81,14 @@ class Launcher { if (typeof options.headless !== 'boolean' || options.headless) { chromeArguments.push( '--headless', - '--disable-gpu', '--hide-scrollbars', '--mute-audio' ); + + // Do not add `--disable-gpu` for linux or macOS platforms when running headless. + // https://bugs.chromium.org/p/chromium/issues/detail?id=737678#c1 + if (process.platform !== 'linux' && process.platform !== 'darwin') + chromeArguments.push('--disable-gpu'); } let chromeExecutable = options.executablePath; if (typeof chromeExecutable !== 'string') {