Here's a script I'd like to share for those interested on filtering out general messages from the chat leaving just the incoming tips. I added a cross out function so you can keep track of all tips by being able to cross them out on click, I.E. after a tip menu "task" is performed/completed. Paste this code in your browsers Dev Tools like Google Chromes Console for example. Let me know if this helps anyone:
const tipSection = document.createElement('div'); // Create a new div for persistent tips
tipSection.id = 'persistent-tips'; // Assign it an ID
document.body.appendChild(tipSection); // Append it to the body
setInterval(() => {
document.querySelectorAll('[data-testid="chat-message"]').forEach(msg => {
const isTip = msg.querySelector('.isTip');
if (isTip) {
msg.style.display = "block"; // Ensure the tip message remains visible
if (!document.getElementById(msg.dataset.ts)) { // Check if the tip is already cloned
const clonedTip = msg.cloneNode(true); // Clone the tip message
clonedTip.id = msg.dataset.ts; // Assign unique ID based on timestamp
tipSection.appendChild(clonedTip); // Add the cloned tip to the new section
}
} else {
msg.remove(); // Remove non-tip messages
}
});
}, 1000);
(function() {
// Add styles for crossed-out text
const style = document.createElement('style');
style.innerHTML = `
.crossed-out {
text-decoration: line-through;
color: gray;
}
`;
document.head.appendChild(style);
// Function to toggle crossed-out effect on clicked tip message
function toggleCrossedOut(event) {
if (event.target && event.target.closest('[data-testid="chat-message"]')) {
const message = event.target.closest('[data-testid="chat-message"]');
message.classList.toggle('crossed-out');
}
}
// Attach the click event listener to the body
document.body.addEventListener('click', toggleCrossedOut);
// Ensure to keep previously processed tips visible and not crossed out by default
document.querySelectorAll('[data-testid="chat-message"]').forEach(message => {
message.classList.remove('crossed-out');
});
})();
const tipSection = document.createElement('div'); // Create a new div for persistent tips
tipSection.id = 'persistent-tips'; // Assign it an ID
document.body.appendChild(tipSection); // Append it to the body
setInterval(() => {
document.querySelectorAll('[data-testid="chat-message"]').forEach(msg => {
const isTip = msg.querySelector('.isTip');
if (isTip) {
msg.style.display = "block"; // Ensure the tip message remains visible
if (!document.getElementById(msg.dataset.ts)) { // Check if the tip is already cloned
const clonedTip = msg.cloneNode(true); // Clone the tip message
clonedTip.id = msg.dataset.ts; // Assign unique ID based on timestamp
tipSection.appendChild(clonedTip); // Add the cloned tip to the new section
}
} else {
msg.remove(); // Remove non-tip messages
}
});
}, 1000);
(function() {
// Add styles for crossed-out text
const style = document.createElement('style');
style.innerHTML = `
.crossed-out {
text-decoration: line-through;
color: gray;
}
`;
document.head.appendChild(style);
// Function to toggle crossed-out effect on clicked tip message
function toggleCrossedOut(event) {
if (event.target && event.target.closest('[data-testid="chat-message"]')) {
const message = event.target.closest('[data-testid="chat-message"]');
message.classList.toggle('crossed-out');
}
}
// Attach the click event listener to the body
document.body.addEventListener('click', toggleCrossedOut);
// Ensure to keep previously processed tips visible and not crossed out by default
document.querySelectorAll('[data-testid="chat-message"]').forEach(message => {
message.classList.remove('crossed-out');
});
})();