Initialize the Script with the first browser tab (#47)

Suggestion for the script to start under the first tab of the browser, in order to reduce memory consumption.
This commit is contained in:
Fernando Cardoso
2020-02-11 14:53:18 -03:00
committed by GitHub
parent d5a26add20
commit e385563883

View File

@@ -44,7 +44,7 @@ class Client extends EventEmitter {
*/
async initialize() {
const browser = await puppeteer.launch(this.options.puppeteer);
const page = await browser.newPage();
const page = (await browser.pages())[0];
page.setUserAgent(UserAgent);
if (this.options.session) {