From f4d0e9ad8721d8f7c781f732f9fc3c089eff551c Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Fri, 15 Nov 2019 23:59:34 +0100 Subject: [PATCH] fix(core): update --- ts/smartpuppeteer.classes.smartpuppeteer.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ts/smartpuppeteer.classes.smartpuppeteer.ts b/ts/smartpuppeteer.classes.smartpuppeteer.ts index 4a9294d..e61838a 100644 --- a/ts/smartpuppeteer.classes.smartpuppeteer.ts +++ b/ts/smartpuppeteer.classes.smartpuppeteer.ts @@ -19,21 +19,30 @@ export const getEnvAwareBrowserInstance = async ( if ((process.env.CI || options.forceNoSandbox) && !smartenv.isWsl) { chromeArgs = chromeArgs.concat([ '--no-sandbox', - '--disable-setuid-sandbox' - // '--disable-dev-shm-usage' + '--disable-setuid-sandbox', + '--disable-dev-shm-usage' ]); } let headlessBrowser: plugins.puppeteer.Browser; if (!smartenv.isWsl) { // lets get the actual instance + console.log('launching puppeteer bundled chrome'); headlessBrowser = await plugins.puppeteer.launch({ args: chromeArgs }); } else { console.log('Detected WSL. Using chromium.'); headlessBrowser = await plugins.puppeteer.launch({ - executablePath: '/usr/bin/chromium-browser' + args: [ + '--disable-gpu', + '--disable-dev-shm-usage', + '--disable-setuid-sandbox', + '--no-first-run', + '--no-sandbox', + '--no-zygote', + '--single-process' + ] }); }