Facebook Chat Group Chat Painter

Paint the title of group chats in different color to make them easier to distinguish

// ==UserScript==
// @name        Facebook Chat Group Chat Painter
// @namespace   userscript.danielrozenberg.com
// @description Paint the title of group chats in different color to make them easier to distinguish
// @include     https://www.facebook.com/*
// @version     1.1
// @grant       none
// ==/UserScript==


// Add the CSS style to the page
var style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = ".focusedTab .__fcgcp_group { background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVAQMAAACT2TfVAAAABlBMVEUAAAAAAAClZ7nPAAAAAnRSTlMAKEMmZcIAAAA9SURBVAjXdcmhFYAgFADA4xm0WW2uYXMtm4zGKIxA/IHHYwKunoHuEC7No/oUIadgC/bGWbkLb+bHIPVlT7UWFLs2cSVZAAAAAElFTkSuQmCC) !important; }";
document.head.appendChild(style);

// Define the repainting function and set it to run on interval
function repaintChats() {
  for (elm of document.querySelectorAll('.fbNubFlyout .titlebar:not(.__fcgcp)')) {
    elm.classList.add('__fcgcp');
    if (elm.querySelector('a.titlebarText[href*="/messages/conversation"]')) {
      elm.classList.add('__fcgcp_group');
    }
  }
}

window.setInterval(repaintChats, 100);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址