Greasy Fork is available in English.

hack-chat

xxxxxx

// ==UserScript==
// @name         hack-chat
// @description  xxxxxx
// @namespace    hack_chat
// @version      1.01
// @author       vizo
// @require      https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
// @include      *://*hack.chat/*
// @include      *://*henrize.kim*
// @run-at       document-start
// @grant        GM_addStyle
// @grant        GM_setValue
// @grant        GM_getValue
// @noframes


// ==/UserScript==

'use strict'

GM_addStyle(`
  .container {
    border: 1px solid #444;
  }
  #chatform {
    border: 1px solid #313336;
  }
  #footer {
    bottom: 40px;
  }
  #messages {
    padding-bottom: 160px;
  }
  .message {
    color: #777;  
  }
  #chatinput {
    color: #777;
    font-family: sans-serif;
    width: 100%;
    height: 100%;
    padding: 10px 10px;
  }
`)

$(function () {
  const observerDom = () => {
    let observer = new MutationObserver((mutations, observer) => {
      mutations.forEach((mutation) => {
        if (mutation.addedNodes.length) {
          eachDom(mutation.addedNodes)
        }
      })
    })
    observer.observe(document.querySelector('#messages'), {
      childList: true,
    })
  }
  
  observerDom()
  
  const eachDom = (nodelist) => {
    let blockArr = ['do_ob', 'fucco', 'fuccist']
    $(nodelist).each(function() {
      let tis = $(this)
      let nick = tis.find('.nick a').text()
      if (blockArr.includes(nick)) {
        tis.remove()
      }
    })
  }
  
})