Store.checkNumberBeta empty on new bootstrap_qr.js file
See original GitHub issueDescription
After running the function injectParasite
, the key Store.checkNumberBeta
is undefined
.
However, this happens only when the WhatsApp Web page loads the js file bootstrap_qr.79aba964bea38dbcc501.js
From what I tested, sometimes the page loads the file bootstrap_qr.4ec5f0d2877d5f3b7590.js, and in this case the current conditions of checkNumberBeta
in storeObjects
works fine.
This happens because in the new js file (hash 79aba9...
) the queryExists
function was moved from being the single default export of a module, to being one of two functions of a new module containing:
t.queryExists = function (e) ...
t.queryPhoneExists = function (e) ...
Module code in bootstrap_qr.79aba964bea38dbcc501.js
Because of this situation, any place that calls WAPI.checkNumberStatus
can have problems, like this one on #1519
Environment
- Venom version(s): 4.0.7 (using
WAPI
directly) - Browser: Chrome 99
- OS: Ubuntu 21.10
- Node version: Node 17
Your Code
To fix this, I changed the checkNumberBeta
object in the storeObjects
to:
{
id: 'checkNumberBeta',
conditions: (module) => {
// function 'queryExists' is on bootstrap_qr.79aba964bea38dbcc501.js
// function 'default' is on bootstrap_qr.4ec5f0d2877d5f3b7590.js
const f = module.queryExists || module.default || {};
return typeof f.toString === 'function' &&
f.toString().includes('Should not reach queryExists MD')
? { queryExists: f }
: null
},
},
And changed the call on checkNumberStatus
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top GitHub Comments
https://gist.github.com/jamesxt94/fae5bf879d875c46ebb82a6c9e9cae1d
I only changed the
storeObjects
file, and these lines to: