From e38556388344309a2ce8e8014037fb8dc646c6f5 Mon Sep 17 00:00:00 2001 From: Fernando Cardoso Date: Tue, 11 Feb 2020 14:53:18 -0300 Subject: [PATCH] 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. --- src/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index c1283bd..1c72354 100644 --- a/src/Client.js +++ b/src/Client.js @@ -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) {