Skip to content

Instantly share code, notes, and snippets.

@sagic
sagic / wsapp-reply.js
Created January 24, 2017 12:26
reply to web whatsapp spammers
// import/require jquery (or copy from cdn) and then:
var lastText = '';
$('.pane-chat .message-list').bind('DOMSubtreeModified',function(e){
var txt = $('.pane-chat .message-list .msg').last()[0].innerText;
if (lastText !== txt) {
lastText = txt;
// console.log(lastText);
if (lastText.indexOf('Yossi') > -1) { // search for an incoming message text