diff options
author | Valtteri Vuorikoski <vuori@notcom.org> | 2020-07-17 17:07:06 +0300 |
---|---|---|
committer | Valtteri Vuorikoski <vuori@notcom.org> | 2020-09-06 16:02:52 +0300 |
commit | d2191eb1c07e5366c0e486c94b05e2cb3cc755f4 (patch) | |
tree | c15b045cbba89f63205fe6df11d254e6e4a7ea75 | |
parent | 1da14bc23c96680a40aee55ca7b32c8bba440c73 (diff) |
Allow customizing puppeteer headless & proxy with env.
-rw-r--r-- | index.js | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -20,6 +20,10 @@ const responseHeadersToRemove = ["Accept-Ranges", "Content-Length", "Keep-Alive" }; if (process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD) options.executablePath = '/usr/bin/chromium-browser'; + if (process.env.PUPPETEER_HEADFUL) + options.headless = false; + if (process.env.PUPPETEER_PROXY) + options.args.push(`--proxy-server=${process.env.PUPPETEER_PROXY}`); const browser = await puppeteer.launch(options); app.use(async ctx => { if (ctx.query.url) { |