Closed sandro-salles closed 4 years ago
Thanks @sandro-salles I'll test this out.
@github-actions run
7d5b1c2
blockAssets
for better launch performance #638 b54a10e
safeMode: false
#640 c7f697b
b5a09d2
d5569dd
10b8aa4
This feature is now implemented. In order to use these performance, enhancements please set safeMode: false
in config.
Thanks @sandro-salles great work π
While testing here I found that sometimes, depending on the amount of opened chats a specific whatsapp account has, the initial load time after a successful qrcode scan (or even after login with previous session data available) can take longer (the page must parse/render all chats before the conditions of auth/isInsideChat are met).
By observing the requests that are triggered from whatsapp web, I was able to find the first requests that indicate that user is authenticated. And they happen several seconds before isInsideChat returns true. Sometimes 10 seconds before. The first one is to this javascript:
https://web.whatsapp.com/lazy_loaded_high_priority_components~lazy_loaded_low_priority_components.fcf172f23f363a24f1bf.js
Then I added this logic and saw a big improvement on the authentication check time:
On browser.ts/initClient:
And then, on auth.ts/isInsideChat:
On auth.ts/retrieveQR:
And finally on initializer.ts/create:
Now authentication resolves faster (specially when sessionData is available, sometimes in less than 3 secs). Maybe you could add that check when safeMode is false or something... what you think?
Regards