baturax / Whatsapp better read-unread colors

// ==UserScript==
// @name        Whatsapp better read-unread colors
// @namespace   Violentmonkey Scripts
// @match       https://web.whatsapp.com/*
// @grant       none
// @license     MIT
// @version     1.1
// @author      Baturax
// @description Whatsapp better colors - 7/21/2025
// ==/UserScript==

function recolor() {
  document.querySelectorAll('span[aria-label=" Delivered "]').forEach(span => {
    span.style.color = 'gray';
  });
  document.querySelectorAll('span[aria-label=" Read "]').forEach(span => {
    span.style.color = 'black';
  });
}

recolor();

const observer = new MutationObserver(mutations => {
  recolor();
});

const chatContainer = document.querySelector('#pane-side') || document.body;

if (chatContainer) {
  observer.observe(chatContainer, {
    childList: true,
    subtree: true
  });
}