Twitch.tv highlights first chats from users - Dark mode

Highlights a username in the chat in blue if it's the first time they sent a message in your browser session, then adds them to a list of observed chatters and adds a mutationoberver to look for new chats.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Twitch.tv highlights first chats from users - Dark mode
// @namespace   https://greasyfork.org/users/1188705
// @version     1.0
// @description Highlights a username in the chat in blue if it's the first time they sent a message in your browser session, then adds them to a list of observed chatters and adds a mutationoberver to look for new chats.
// @author      sunmilk50
// @license     public domain
// @match       https://www.twitch.tv/*
// @grant       none
// ==/UserScript==
(function(){const b=new Set;(new MutationObserver(function(e){e.forEach(function(c){"childList"===c.type&&Array.from(c.addedNodes).forEach(a=>{if(a.classList&&a.classList.contains("chat-line__message")){const d=a.querySelector(".chat-author__display-name").innerText;b.has(d)||(a.style.backgroundColor="blue",b.add(d))}})})})).observe(document.body,{childList:!0,subtree:!0})})();