// Select all elements with the class 'postMessage'elements=document.querySelectorAll('.postMessage');// Create an object to store text content and their occurrencestextContentMap={};// Iterate over the elements and populate the textContentMapelements.forEach(element=>{consttextContent=element.textContent.replace(/>>\d+(?:\s+\(You\))?(?:\s+\(Cross-thread\))?#?/gm,'').trim();if(!textContent){return;}if(textContentMap[textContent]){textContentMap[textContent].push(element);}else{textContentMap[textContent]=[element];}});// Find and log the later occurrences of duplicated text contentObject.values(textContentMap).forEach(elementsWithSameText=>{if(elementsWithSameText.length>1){// Log or process the later occurrenceselementsWithSameText.slice(1).forEach(element=>{element.style.background='#f00';console.log(element);// Replace this with your desired action});}});
Warning
LINK
You are about to visit a link which has been flagged with the above content warnings. Do you wish to continue?