Webwhatsapp-wrapper: It's possible to exit of whatsapp web session?

Created on 2 Jun 2018  Â·  8Comments  Â·  Source: mukulhase/WebWhatsapp-Wrapper

Hello, I need to exit of a session in whatsapp web with this API, or better, using javascript. But I don't find a function to exit of session.
Can you help me?
Thanks!

help needed

Most helpful comment

Temporary and ugly soluction:

function logout() {
ed = document.getElementsByClassName("rAUz7")[2];
bt = ed.getElementsByTagName("div")[0];
    if (document.createEvent) { 
     var event1 = document.createEvent("MouseEvents"); 
     event1.initEvent("mousedown", true, true);
     bt.dispatchEvent(event1);
    }
ed = document.getElementsByClassName("_3lSL5 _2dGjP")[5];    
ed.click();
}

All 8 comments

Why don’t you just remove the saved profile and up a new Firefox instance??

It's not a good idea exit the browser instance
The cellphone will stay connected in two browsers, and for my purpose isn't
cool close a window, cause I verify each browser instance..

Em Sáb, 2 de jun de 2018 19:08, Bruno Soares da Silva <
[email protected]> escreveu:

Why don’t you just remove the saved profile and up a new Firefox instance??

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/257#issuecomment-394120584,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALQWYwgcBvyBayJXhHf6aatwu6vY21_lks5t4wzJgaJpZM4UX1_I
.

How about deleting the elements of the directory containing the sessions
saved elemnts? This should give you a new Session on a restart (or simply
destroy the wapi Object and create a new one afer deleting the elements)

Gabriel Henrique notifications@github.com schrieb am So., 3. Juni 2018,
16:39:

It's not a good idea exit the browser instance
The cellphone will stay connected in two browsers, and for my purpose isn't
cool close a window, cause I verify each browser instance..

Em Sáb, 2 de jun de 2018 19:08, Bruno Soares da Silva <
[email protected]> escreveu:

Why don’t you just remove the saved profile and up a new Firefox
instance??

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<
https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/257#issuecomment-394120584
,
or mute the thread
<
https://github.com/notifications/unsubscribe-auth/ALQWYwgcBvyBayJXhHf6aatwu6vY21_lks5t4wzJgaJpZM4UX1_I

.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/257#issuecomment-394166847,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGhecfTmpzTaG1DP-xQK4JJHnEphDLWsks5t4_UtgaJpZM4UX1_I
.

Can you describe for us your use case/purpose?

@brunosoaresds Please see comment from @Gabrieldesousah

Here is snippet for your reference:

It's not a good idea exit the browser instance The cellphone will stay connected in two browsers, and for my purpose isn't cool close a window, cause I verify each browser instance.

Here I found conn object, with logout() method, but it doesnt works any more.

conn = document.querySelector("#app")._reactRootContainer.current.child.child.child.child.child.child.sibling.sibling.sibling.sibling.sibling.memoizedProps.conn._listeningTo.l3;
conn.logout();

@eduardobento please format your code in the future

Temporary and ugly soluction:

function logout() {
ed = document.getElementsByClassName("rAUz7")[2];
bt = ed.getElementsByTagName("div")[0];
    if (document.createEvent) { 
     var event1 = document.createEvent("MouseEvents"); 
     event1.initEvent("mousedown", true, true);
     bt.dispatchEvent(event1);
    }
ed = document.getElementsByClassName("_3lSL5 _2dGjP")[5];    
ed.click();
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

FeezyHendrix picture FeezyHendrix  Â·  3Comments

kashif-raza picture kashif-raza  Â·  5Comments

drsoporte picture drsoporte  Â·  5Comments

dmreinoso picture dmreinoso  Â·  3Comments

dafner picture dafner  Â·  6Comments