mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 20:49:14 +00:00
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:
@@ -44,7 +44,7 @@ class Client extends EventEmitter {
|
|||||||
*/
|
*/
|
||||||
async initialize() {
|
async initialize() {
|
||||||
const browser = await puppeteer.launch(this.options.puppeteer);
|
const browser = await puppeteer.launch(this.options.puppeteer);
|
||||||
const page = await browser.newPage();
|
const page = (await browser.pages())[0];
|
||||||
page.setUserAgent(UserAgent);
|
page.setUserAgent(UserAgent);
|
||||||
|
|
||||||
if (this.options.session) {
|
if (this.options.session) {
|
||||||
|
|||||||
Reference in New Issue
Block a user