AWBW Viewer Count Hider

Hides viewer count

  1. // ==UserScript==
  2. // @name AWBW Viewer Count Hider
  3. // @namespace https://awbw.amarriner.com/
  4. // @version 1.0
  5. // @description Hides viewer count
  6. // @icon https://awbw.amarriner.com/favicon.ico
  7. // @author lol
  8. // @match https://awbw.amarriner.com/game.php?games_id=*
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. function hideViewerCount(node) {
  17. const viewer = node.querySelector('.game-viewer-count');
  18. if (viewer) {
  19. const cover = document.createElement('span');
  20. cover.textContent = '???';
  21. cover.style.fontWeight = 'bold';
  22. cover.style.color = '#000';
  23. node.replaceWith(cover);
  24. }
  25. }
  26.  
  27. document.querySelectorAll('span.small_text_14.bold').forEach(hideViewerCount);
  28.  
  29. const observer = new MutationObserver(mutations => {
  30. for (const mutation of mutations) {
  31. for (const node of mutation.addedNodes) {
  32. if (node.nodeType === 1) {
  33. if (node.matches && node.matches('span.small_text_14.bold')) {
  34. hideViewerCount(node);
  35. } else if (node.querySelector) {
  36. const match = node.querySelector('span.small_text_14.bold');
  37. if (match) hideViewerCount(match);
  38. }
  39. }
  40. }
  41. }
  42. });
  43.  
  44. observer.observe(document.body, {
  45. childList: true,
  46. subtree: true
  47. });
  48. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址