From 6878598a5d3eb431c1473cc224d6e155fbf97325 Mon Sep 17 00:00:00 2001 From: tuyuribr <45042245+tuyuribr@users.noreply.github.com> Date: Sat, 5 Feb 2022 16:42:25 -0300 Subject: [PATCH] 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 --- src/Client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index 2888dd2..643844a 100644 --- a/src/Client.js +++ b/src/Client.js @@ -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;