Commit 806791c0 authored by Myroslava Stavnycha's avatar Myroslava Stavnycha Committed by Fred Chasen
Browse files

connect to existing browser if browserWSEndpoint is set

parent f6b3b46a
......@@ -44,13 +44,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