HIDE PLAYER

Hide specific player on bonk.io with Alt+H

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         HIDE PLAYER
// @namespace    http://tampermonkey.net/
// @version      0.3
// @description  Hide specific player on bonk.io with Alt+H
// @author       You
// @match        https://bonk.io/*
// @grant        none
// ==/UserScript==


    // ==UserScript==


(function() {
    'use strict';

    document.addEventListener('keydown', function(event) {
        // Check if the pressed key is 'h' and the 'Alt' key is pressed
        if (event.altKey && event.key === 'h') {
            // Display 'HIDDEN ON' in the lobby chat
            const chatMessage = document.querySelector('.newbonklobby_chat_msg_txt');
            if (chatMessage) {
                chatMessage.textContent = 'HIDDEN ON';
            }

            // Make the in-game chat box visible if not already visible
            const inGameChatBox = document.getElementById('ingamechatbox');
            if (inGameChatBox && inGameChatBox.style.visibility !== 'visible') {
                inGameChatBox.style.visibility = 'visible';
            }

            // Inject styles to hide player during in-game
            GM_addStyle('.newbonklobby_playerentry_menuhighlighted { display: none !important; }');
        }
    });
})();