Twitch Bits-Off

Removes bits and gains in the channel points panel

  1. // ==UserScript==
  2. // @name Twitch Bits-Off
  3. // @name:ru Twitch - Убрать Битсы 2024
  4. // @namespace https://mjkey.ru/
  5. // @supportURL https://www.donationalerts.com/r/mjk3y
  6. // @version 24.06.16
  7. // @description Removes bits and gains in the channel points panel
  8. // @description:ru Убирает битсы и усиления в панели баллов канала
  9. // @author MjKey
  10. // @license MIT
  11. // @match *://*.twitch.tv/*
  12. // @icon https://assets.twitch.tv/assets/favicon-32-e29e246c157142c94346.png
  13. // @grant none
  14. // @run-at document-idle
  15. // ==/UserScript==
  16.  
  17. (function() {
  18. 'use strict';
  19.  
  20. const a = () => {
  21. const b = element => element.style.setProperty('display', 'none', 'important');
  22.  
  23. const c = document.querySelector('.Layout-sc-1xcs6mc-0.kKpGeT');
  24. if (c && !c.querySelector('.channel-points-icon__image')) {
  25. b(c);
  26. }
  27.  
  28. const d = document.querySelectorAll('.Layout-sc-1xcs6mc-0.cFdOrq');
  29. d.forEach(b);
  30.  
  31. const e = document.querySelectorAll('.Layout-sc-1xcs6mc-0.kbdfeJ');
  32. e.forEach(element => {
  33. if (!element.querySelector('.Layout-sc-1xcs6mc-0.xxjeD')) {
  34. if(!element.querySelector('.live-time')){
  35. b(element);
  36. }
  37. }
  38. });
  39.  
  40. const f = document.querySelectorAll('.Layout-sc-1xcs6mc-0.cxywwo');
  41. f.forEach(container => {
  42. const g = container.querySelector('.Layout-sc-1xcs6mc-0');
  43. if (g) {
  44. let h = g.previousSibling;
  45. while (h && h.nodeType !== Node.TEXT_NODE) {
  46. h = h.previousSibling;
  47. }
  48. if (h) {
  49. h.textContent = '';
  50. }
  51. container.querySelector('div.Layout-sc-1xcs6mc-0.ScTooltipWrapper-sc-31h4d9-0.cQRCoy.etwtmn.tw-tooltip-wrapper > div > div').remove();
  52. }
  53. });
  54.  
  55. const i = document.querySelector('.Layout-sc-1xcs6mc-0.ftDwiu.rewards-list');
  56. if (i) {
  57. let j = 0;
  58. for (let div = i.firstChild; div; div = div.nextSibling) {
  59. if (div.classList && div.classList.contains('Layout-sc-1xcs6mc-0') && div.classList.contains('ZvPWT')) {
  60. j++;
  61. if (j > 1) break;
  62. }
  63. if (div.tagName === 'DIV') {
  64. b(div);
  65. }
  66. }
  67. }
  68.  
  69. const k = document.querySelectorAll('.Layout-sc-1xcs6mc-0.czRfnU');
  70. k.forEach(element => {
  71. if (element.querySelector('[data-a-target="top-nav-get-bits-button"]')) {
  72. b(element);
  73. }
  74. });
  75.  
  76. const l = document.querySelectorAll('.Layout-sc-1xcs6mc-0.emBnMs');
  77. l.forEach(m => {
  78. const n = m.querySelectorAll('.CoreText-sc-1txzju1-0.fLrMgR');
  79. n.forEach(o => {
  80. o.textContent = o.title = 'Награды';
  81. });
  82. });
  83.  
  84. const z = document.querySelector('[data-a-target="bits-button"]');
  85. z && b(z);
  86. };
  87.  
  88. a();
  89. const observer = new MutationObserver(a);
  90. observer.observe(document.body, { childList: true, subtree: true });
  91. })();