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);