1
Fork 0

fall back to running browser headlessly when DISPLAY is not set

This commit is contained in:
Conduitry 2023-09-07 09:59:11 -04:00
parent 5b1bbaaf23
commit e5c7ad34cc
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ if (process.argv.length !== 3) {
process.exit(1);
}
const browser = await firefox.launch({ headless: false });
const browser = await firefox.launch({ headless: !process.env.DISPLAY });
browser.on('disconnected', () => process.exit(1));
const context = await browser.newContext();
const page = await context.newPage();