Twitch Bits-Off

Removes bits and gains in the channel points panel

当前为 2024-06-14 提交的版本,查看 最新版本

  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.15
  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. c && b(c);
  25.  
  26. const d = document.querySelectorAll('.Layout-sc-1xcs6mc-0.cFdOrq');
  27. d.forEach(b);
  28.  
  29. const e = document.querySelectorAll('.Layout-sc-1xcs6mc-0.kbdfeJ');
  30. e.forEach(b);
  31.  
  32. const f = document.querySelectorAll('.Layout-sc-1xcs6mc-0.cxywwo');
  33. f.forEach(container => {
  34. const g = container.querySelector('.Layout-sc-1xcs6mc-0');
  35. if (g) {
  36. let h = g.previousSibling;
  37. while (h && h.nodeType !== Node.TEXT_NODE) {
  38. h = h.previousSibling;
  39. }
  40. if (h) {
  41. h.textContent = '';
  42. }
  43. container.querySelector('div.Layout-sc-1xcs6mc-0.ScTooltipWrapper-sc-31h4d9-0.cQRCoy.etwtmn.tw-tooltip-wrapper > div > div').remove();
  44. }
  45. });
  46.  
  47. const i = document.querySelector('.Layout-sc-1xcs6mc-0.ftDwiu.rewards-list');
  48. if (i) {
  49. let j = 0;
  50. for (let div = i.firstChild; div; div = div.nextSibling) {
  51. if (div.classList && div.classList.contains('Layout-sc-1xcs6mc-0') && div.classList.contains('ZvPWT')) {
  52. j++;
  53. if (j > 1) break;
  54. }
  55. if (div.tagName === 'DIV') {
  56. b(div);
  57. }
  58. }
  59. }
  60.  
  61. const k = document.querySelectorAll('.Layout-sc-1xcs6mc-0.czRfnU');
  62. k.forEach(element => {
  63. if (element.querySelector('[data-a-target="top-nav-get-bits-button"]')) {
  64. b(element);
  65. }
  66. });
  67.  
  68. const l = document.querySelectorAll('.Layout-sc-1xcs6mc-0.emBnMs');
  69. l.forEach(m => {
  70. const n = m.querySelectorAll('.CoreText-sc-1txzju1-0.fLrMgR');
  71. n.forEach(o => {
  72. o.textContent = o.title = 'Награды';
  73. });
  74. });
  75. // Удаление элемента с атрибутом data-a-target="bits-button"
  76. const z = document.querySelector('[data-a-target="bits-button"]');
  77. z && b(z);
  78. };
  79.  
  80. a();
  81. const observer = new MutationObserver(a);
  82. observer.observe(document.body, { childList: true, subtree: true });
  83. })();