A popular person in our community receives a lot of WhatsApp messages — in thousands — especially during events and he obviously cannot reply or even read all of them. He asked me if there was a way toMark as Read all messages so I came up with this quick and dirty solution that works inWhatsApp Web.
Just copy and paste the following script in the browser console and wait for it to finish. It marks a message as read every 2 seconds.
consttriggerMouseEvent=(node,eventType)=>{varclickEvent=document.createEvent("MouseEvents");clickEvent.initEvent(eventType,true,true);node.dispatchEvent(clickEvent);},timer=(ms)=>{returnnewPromise((res)=>setTimeout(res,ms));},selector='[aria-label*="unread message"]',messages=(async()=>{for(constmessageofdocument.querySelectorAll(selector)){["mouseover","mousedown","mouseup","click"].map((event)=>triggerMouseEvent(message,event));awaittimer(2000);}})();
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse