fix: await promise when setting user agent (#1113)

Some of my devices were bugging out because the setUserAgent didn't had an await, after this everything was working fine (try loading the wwebjs in a broken microSd ahhaha).

We need some testing but on my limited testing everything is working

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
tuyuribr
2022-02-05 16:42:25 -03:00
committed by GitHub
parent 4e6a00dffe
commit 6878598a5d

View File

@@ -76,7 +76,7 @@ class Client extends EventEmitter {
page = (await browser.pages())[0];
}
page.setUserAgent(this.options.userAgent);
await page.setUserAgent(this.options.userAgent);
this.pupBrowser = browser;
this.pupPage = page;