Greasy Fork is available in English.

HIDE PLAYER

Hide specific player on bonk.io with Alt+H

  1. // ==UserScript==
  2. // @name HIDE PLAYER
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Hide specific player on bonk.io with Alt+H
  6. // @author You
  7. // @match https://bonk.io/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11.  
  12. // ==UserScript==
  13.  
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. document.addEventListener('keydown', function(event) {
  19. // Check if the pressed key is 'h' and the 'Alt' key is pressed
  20. if (event.altKey && event.key === 'h') {
  21. // Display 'HIDDEN ON' in the lobby chat
  22. const chatMessage = document.querySelector('.newbonklobby_chat_msg_txt');
  23. if (chatMessage) {
  24. chatMessage.textContent = 'HIDDEN ON';
  25. }
  26.  
  27. // Make the in-game chat box visible if not already visible
  28. const inGameChatBox = document.getElementById('ingamechatbox');
  29. if (inGameChatBox && inGameChatBox.style.visibility !== 'visible') {
  30. inGameChatBox.style.visibility = 'visible';
  31. }
  32.  
  33. // Inject styles to hide player during in-game
  34. GM_addStyle('.newbonklobby_playerentry_menuhighlighted { display: none !important; }');
  35. }
  36. });
  37. })();