Created
October 2, 2020 02:28
-
-
Save jacksonfdam/aebe1e9e605531f5c3b46e60859da203 to your computer and use it in GitHub Desktop.
whatsappweb.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
How to use it? | |
Open chrome, then visit web.whatsapp.com | |
Press F12, click at console | |
Copy the code bellow and paste into console. | |
Don't worry, you can trust me, I am a loveeeely person. | |
*/ | |
const eventFire = (el, etype) => { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent(etype, true, true, window,0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
el.dispatchEvent(evt); | |
} | |
let chatItem = document.querySelector("#pane-side > div:nth-child(1) > div > div > div:nth-child(3)"); | |
eventFire(chatItem,"click") | |
let menu = document.querySelector("#main > header > div > div > div:nth-child(2) > div") | |
eventFire(menu,"click") | |
let clearMessagesItem = document.querySelector("#main > header > div > div > div > span > div > ul > li:nth-child(4)") | |
eventFire(clearMessagesItem,"click") | |
let confirmClear = document.querySelector("#app > div > span:nth-child(2) > div > div > div > div > div > div > div > div:nth-child(2)") | |
eventFire(confirmClear,"click") | |
/*********************************************************************************************************/ | |
var groups = [...document.querySelectorAll('#pane-side span[data-testid="default-group"]')] | |
var i = -1 | |
(function f(){ | |
i = (i + 1) % groups.length; | |
var chatEl = groups[i].parentNode.parentNode.parentNode.parentNode | |
simulateClick(chatEl); | |
eventFire(chatEl,"click") | |
setTimeout(f, 5000); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To get users just set: