Skip to content

Commit

Permalink
Merge pull request alvarcarto#122 from Antevenio/master
Browse files Browse the repository at this point in the history
Adding browser executable path option
  • Loading branch information
kimmobrunfeldt authored Jan 14, 2020
2 parents 970207b + 2976d6c commit d8ea93c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
};

Expand Down
3 changes: 3 additions & 0 deletions src/core/render-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d8ea93c

Please sign in to comment.