Twitch Bits-Off

Removes bits and gains in the channel points panel

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            Twitch Bits-Off
// @name:ru         Twitch - Убрать Битсы 2024
// @namespace       https://mjkey.ru/
// @supportURL      https://www.donationalerts.com/r/mjk3y
// @version         24.06.16
// @description     Removes bits and gains in the channel points panel
// @description:ru  Убирает битсы и усиления в панели баллов канала
// @author          MjKey
// @license         MIT
// @match           *://*.twitch.tv/*
// @icon            https://assets.twitch.tv/assets/favicon-32-e29e246c157142c94346.png
// @grant           none
// @run-at          document-idle
// ==/UserScript==

(function() {
  'use strict';

  const a = () => {
    const b = element => element.style.setProperty('display', 'none', 'important');

    const c = document.querySelector('.Layout-sc-1xcs6mc-0.kKpGeT');
    if (c && !c.querySelector('.channel-points-icon__image')) {
      b(c);
    }

    const d = document.querySelectorAll('.Layout-sc-1xcs6mc-0.cFdOrq');
    d.forEach(b);

    const e = document.querySelectorAll('.Layout-sc-1xcs6mc-0.kbdfeJ');
    e.forEach(element => {
      if (!element.querySelector('.Layout-sc-1xcs6mc-0.xxjeD')) {
          if(!element.querySelector('.live-time')){
              b(element);
          }
      }
    });

    const f = document.querySelectorAll('.Layout-sc-1xcs6mc-0.cxywwo');
    f.forEach(container => {
      const g = container.querySelector('.Layout-sc-1xcs6mc-0');
      if (g) {
        let h = g.previousSibling;
        while (h && h.nodeType !== Node.TEXT_NODE) {
          h = h.previousSibling;
        }
        if (h) {
          h.textContent = '';
        }
        container.querySelector('div.Layout-sc-1xcs6mc-0.ScTooltipWrapper-sc-31h4d9-0.cQRCoy.etwtmn.tw-tooltip-wrapper > div > div').remove();
      }
    });

    const i = document.querySelector('.Layout-sc-1xcs6mc-0.ftDwiu.rewards-list');
    if (i) {
      let j = 0;
      for (let div = i.firstChild; div; div = div.nextSibling) {
        if (div.classList && div.classList.contains('Layout-sc-1xcs6mc-0') && div.classList.contains('ZvPWT')) {
          j++;
          if (j > 1) break;
        }
        if (div.tagName === 'DIV') {
          b(div);
        }
      }
    }

    const k = document.querySelectorAll('.Layout-sc-1xcs6mc-0.czRfnU');
    k.forEach(element => {
      if (element.querySelector('[data-a-target="top-nav-get-bits-button"]')) {
        b(element);
      }
    });

    const l = document.querySelectorAll('.Layout-sc-1xcs6mc-0.emBnMs');
    l.forEach(m => {
      const n = m.querySelectorAll('.CoreText-sc-1txzju1-0.fLrMgR');
      n.forEach(o => {
        o.textContent = o.title = 'Награды';
      });
    });

    const z = document.querySelector('[data-a-target="bits-button"]');
    z && b(z);
  };

  a();
  const observer = new MutationObserver(a);
  observer.observe(document.body, { childList: true, subtree: true });
})();