Bonk.io Room hide function

Adds epic room hider

  1. // ==UserScript==
  2. // @name Bonk.io Room hide function
  3. // @namespace http://tampermonkey.net/
  4. // @version 69
  5. // @description Adds epic room hider
  6. // @author Silly One
  7. // @license MIT
  8. // @match https://*.bonk.io/*
  9. // @match https://*.bonkisback.io/*
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. function filterRooms(s) {
  14. s = s.toLowerCase();
  15. let matches = el => el.children[0].textContent.toLowerCase().includes(s);
  16. $('#roomlisttable tr').each((i, el) => {
  17. if (s === "") {
  18. el.hidden = false;
  19. } else {
  20. el.hidden = matches(el);
  21. }
  22. });
  23. }
  24. const inputBox = document.createElement('input');
  25. inputBox.type = 'text';
  26. inputBox.id = 'roomHideInputBox';
  27. inputBox.placeholder = 'Vanish Rooms..';
  28. inputBox.style.cssText = `
  29. float: right;
  30. padding: 2px 8px;
  31. margin: 5px 20px;
  32. border: 2px solid #006157;
  33. border-radius: 5px;
  34. font: large futurept_b1;
  35. `;
  36. const savedInput = localStorage.getItem('roomFilterInput');
  37. if (savedInput) {
  38. inputBox.value = savedInput;
  39. }
  40. const topBar = document.getElementById('roomlisttopbar');
  41. if (topBar) {topBar.appendChild(inputBox);}else{return;}
  42.  
  43. inputBox.addEventListener('keyup', ev => {
  44. filterRooms(ev.target.value);
  45. localStorage.setItem('roomFilterInput', ev.target.value);
  46. });
  47. const roomListObserver = new MutationObserver(() => {
  48. filterRooms(inputBox.value);
  49. });
  50. roomListObserver.observe(document.getElementById('roomlisttable'), {
  51. childList: true,
  52. subtree: true,
  53. });
  54. filterRooms(inputBox.value);

QingJ © 2025

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