From 2976d6cfdb15bb19e9c9f391387ec8073bbcf39a Mon Sep 17 00:00:00 2001 From: Jose Angel Barroso Date: Thu, 9 Jan 2020 16:25:40 +0100 Subject: [PATCH] Adding browser executable path option --- src/config.js | 1 + src/core/render-core.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/config.js b/src/config.js index 4a994d8d..b2aea711 100644 --- a/src/config.js +++ b/src/config.js @@ -9,6 +9,7 @@ const config = { DEBUG_MODE: process.env.DEBUG_MODE === 'true', CORS_ORIGIN: process.env.CORS_ORIGIN || '*', BROWSER_WS_ENDPOINT: process.env.BROWSER_WS_ENDPOINT, + BROWSER_EXECUTABLE_PATH: process.env.BROWSER_EXECUTABLE_PATH, API_TOKENS: [], }; diff --git a/src/core/render-core.js b/src/core/render-core.js index c5f02c40..1b1da83e 100644 --- a/src/core/render-core.js +++ b/src/core/render-core.js @@ -13,6 +13,9 @@ async function createBrowser(opts) { browserOpts.browserWSEndpoint = config.BROWSER_WS_ENDPOINT; return puppeteer.connect(browserOpts); } + if (config.BROWSER_EXECUTABLE_PATH) { + browserOpts.executablePath = config.BROWSER_EXECUTABLE_PATH; + } browserOpts.headless = !config.DEBUG_MODE; browserOpts.args = ['--disable-gpu', '--no-sandbox', '--disable-setuid-sandbox']; return puppeteer.launch(browserOpts);