Commit 996396ab authored by Myroslava Stavnycha's avatar Myroslava Stavnycha
Browse files

connect to existing browser if browserWSEndpoint is set

parent e12cd6da
......@@ -43,13 +43,12 @@ class Printer extends EventEmitter {
if (this.browserWSEndpoint) {
puppeteerOptions.browserWSEndpoint = this.browserWSEndpoint;
this.browser = await puppeteer.connect(puppeteerOptions);
} else {
this.browser = await puppeteer.launch(puppeteerOptions);
}
const browser = await puppeteer.launch(puppeteerOptions);
this.browser = browser;
return browser;
return this.browser;
}
async render(input) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment