-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wapi inject directly on whatsapp web does not work again #2795
Comments
Can you install the code from Github orkestral/master directly? There was a big update to WhatsApp a couple of months ago that totally broke the WAPI insertion and Store item generation. A new method has been devised but has not been officially release yet - so if you can try master branch here, let us know how you get on |
Hi @ghayman, normally if i create a node server and I install it as a dependency, it work well, my use case is am using an electron application and i need to inject the venom as a preload script into the webview. |
Hi @ghayman, I am currently needing the same thing you mentioned, I thought about extracting the WhatsApp session this way const sessionData = await view1.webContents.executeJavaScript( And then inject it into venom but I don't know if it's possible |
I'm not really familiar with how to use this with Electron. Look at the latest code in master branch to see how this now does the code injection |
thanks for the above response, am trying to figure out how the puppeteer Store gets populated |
` await this.page.evaluate(() => {
|
__debug is the module that allows to access all the WhatsApp modules. (NOTE: webpack no longer exists due to WhatsApp changes - there is some backwards compatible code still in there to help when web.whatsapp.com updates in the browser) It should be established before you try and inject wapi.js - here is venom code location On line 60 you can see venom injecting wapi.js |
@ghayman thanks for your help, i was able to have venom working as expected. |
##Issue
Before, I used to inject the WAPI script directly into WhatsApp Web and could successfully get messages and create listeners. However, now when I try to retrieve all contacts or perform similar operations, it fails, and I notice that the Store object is always empty. I’m unsure if others have encountered this issue. While creating a new client with a Node.js server works, my use case requires running it directly on WhatsApp Web. Can you provide any insights or solutions for this problem?
i do this by running the bundle Wapi
i get and error here
Code
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')
when i try getting all contacts
WAPI.getAllContacts();
VM2465:1 Uncaught TypeError: Cannot read properties of undefined (reading 'map')
at window.WAPI.window.WAPI.getAllContacts (:1:86008)
what i this is happening
function injectParasite() {
if (window.__debug) {
getStore(window.getModuleList()).finally();
} else {
if (
window.webpackChunkwhatsapp_web_client &&
Array.isArray(window.webpackChunkwhatsapp_web_client)
) {
const parasite = injectConfig.parasite;
window[injectConfig.webpack].push([
[parasite],
{},
async function (o) {
let modules = [];
for (let idx in o.m) {
modules.push(o(idx));
}
await getStore(modules);
}
]);
}
}
}
I try tracing the code and I noticed that
this inject parasite is been set and i don't think it is ever been called because from what I see when its been call, the Store is been populated
Please I really need help in this,
you can try by running
yarn build:wapi
copy the code in the dist/lib/wapi/wapi.js and paste on the whatsapp web console and press Enter and try any WAPI function, none will work
The text was updated successfully, but these errors were encountered: