headless default to true
This commit is contained in:
@@ -79,18 +79,19 @@ async function renewOne (context, dashboardPage, renewLocator, index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
;(async () => {
|
;(async () => {
|
||||||
|
const isMac = process.platform === 'darwin'
|
||||||
|
|
||||||
// Set HEADLESS=false (or omit) to watch the browser; cron jobs should run
|
// Set HEADLESS=false (or omit) to watch the browser; cron jobs should run
|
||||||
// headless (HEADLESS=true or just leave it — defaults to true when no TTY).
|
// headless (HEADLESS=true or just leave it — defaults to true when no TTY).
|
||||||
const headless =
|
const headless =
|
||||||
process.env.HEADLESS != null
|
process.env.HEADLESS != null
|
||||||
? process.env.HEADLESS !== 'false' && process.env.HEADLESS !== '0'
|
? process.env.HEADLESS !== 'false' && process.env.HEADLESS !== '0'
|
||||||
: !process.stdout.isTTY
|
: isMac ? false : true
|
||||||
|
|
||||||
// On macOS use the installed Microsoft Edge; on Linux (and elsewhere) fall
|
// On macOS use the installed Microsoft Edge; on Linux (and elsewhere) fall
|
||||||
// back to the Chromium bundled by Playwright (run `npx playwright install
|
// back to the Chromium bundled by Playwright (run `npx playwright install
|
||||||
// // chromium` once there). Override by setting BROWSER_CHANNEL, e.g.
|
// // chromium` once there). Override by setting BROWSER_CHANNEL, e.g.
|
||||||
// `BROWSER_CHANNEL=chrome` or `BROWSER_CHANNEL=`.
|
// `BROWSER_CHANNEL=chrome` or `BROWSER_CHANNEL=`.
|
||||||
const isMac = process.platform === 'darwin'
|
|
||||||
const launchOptions = { headless, slowMo: headless ? 0 : 200 }
|
const launchOptions = { headless, slowMo: headless ? 0 : 200 }
|
||||||
if (process.env.BROWSER_CHANNEL != null) {
|
if (process.env.BROWSER_CHANNEL != null) {
|
||||||
if (process.env.BROWSER_CHANNEL)
|
if (process.env.BROWSER_CHANNEL)
|
||||||
|
|||||||
Reference in New Issue
Block a user