fall back to running browser headlessly when DISPLAY is not set
This commit is contained in:
parent
5b1bbaaf23
commit
e5c7ad34cc
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
@ -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();
|
||||
|
|
Loading…
Add table
Reference in a new issue