-
-
Save amritsinghbains/318eda29d0bda1217c730a417a3e0ad0 to your computer and use it in GitHub Desktop.
var removeTheConvo = function() | |
{ | |
try{ | |
$(".msg-thread__topcard-btn--icon").click(); | |
setTimeout(function(){ | |
$(".msg-topcard__full-width-action-button.delete").click(); | |
setTimeout(function(){ | |
$(".confirm-delete-btn").click(); | |
setTimeout(function(){ | |
removeTheConvo(); | |
}, 300); | |
}, 300); | |
}, 300); | |
}catch(err){ | |
setTimeout(function(){ | |
removeTheConvo(); | |
}, 1000); | |
} | |
}; | |
removeTheConvo(); |
Nice one ran it from chrome developer console and it worked :)
Here is an extended code from the above snippet that deletes messages where the subject contains certain string -- it skips other messages by adding a class="passed" -- for different runs you need to refresh the page or open a new tab.
var deleteMessagesMatchSubject = function() {
console.log('Delete with text: ' + window.text);
let els = $('.msg-conversation-listitem');
let i = 0;
while($(els[i]).hasClass('passed') && i <= els.length){
i++;
}
if(i >= els.length) return;
el = els[i];
let txt = $(el).find('.msg-conversation-card__message-snippet-body').text();
if(txt.indexOf(window.text) > -1) {
console.log('Delete this shit: ' + txt);
let link = $(el).find('a');
console.log('link = ' + link);
$(link).click();
setTimeout(()=> {
removeTheConvo();
}, 1000);
} else {
$(el).addClass('passed');
deleteMessagesMatchSubject();
}
}
var removeTheConvo = function()
{
try{
$(".msg-thread__topcard-btn--icon").click();
setTimeout(function(){
$(".msg-topcard__full-width-action-button.delete").click();
setTimeout(function(){
$(".confirm-delete-btn").click();
setTimeout(function(){
deleteMessagesMatchSubject();
}, 300);
}, 300);
}, 300);
}catch(err){
setTimeout(function(){
deleteMessagesMatchSubject();
}, 1000);
}
};
window.text = 'Congrat';
deleteMessagesMatchSubject();
This is very helpful however it only deletes what is on my screen not my entire inbox which is HUGE. Can you please help me?
Could you share the code for LinkedIn recruiter? The code works well on the free account.
Thank you.
That doesn't seem to work for me... I get a number or errors...
n {stack: "Error: Attempted to handle event deleteRecord
on…n.com/sc/h/br/8gesdixxb0mdd0yupx7pukf2q:1278:384)", description: undefined, fileName: undefined, lineNumber: undefined, message: "Attempted to handle event deleteRecord
on <messa…398261248> while in state root.deleted.inFlight. ", …}
any ideas?
Very good! This code only didn´t work to marketing messages.
For this things I have to archive this messages.
Here's an updated one - https://gist.github.com/twhitacre/d4536183c22a2f5a8c7c427df04acc90
@1r0 Did you ever find out how to archive instead of delete.
Also, I know this is nitpicky, but would there be a way to only delete the first message instead of the whole conversion? I have a bunch of messages that I initiated, but I only care about the response, all the 1st messages I sent out are useless to me.
Also, to add to this, Really great job! Works perfectly. Thanks @amritsinghbains