Auto Click Chatbox

This script automatically clicks the "Chat" button and "Message Input" on the sidebar, on kick.com.

Verze ze dne 20. 11. 2023. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

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

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

    // ==UserScript==
    // @name        Auto Click Chatbox
    // @namespace   https://greasyfork.org/en/users/1200587-trilla-g
    // @match       *://*.kick.com/*
    // @grant       none
    // @version     1.0
    // @license     MIT
    // @author      Trilla_G
    // @description This script automatically clicks the "Chat" button and "Message Input" on the sidebar, on kick.com.
    // ==/UserScript==
     
    (function() {
        'use strict';
     
        function isLive() {
            let liveDisplay = document.querySelector(".vjs-live-control");
            return liveDisplay && !liveDisplay.classList.contains('vjs-hidden');
        }
     
        function clickChatAndMessageInput() {
            let chatButton = document.querySelector('#chat-button');
            let messageInputButton = document.querySelector('#message-input');
     
            if (isLive()) {
                if (messageInputButton) {
                    messageInputButton.click();
                }
            } else {
                if (chatButton) {
                    chatButton.click();
                }
                if (messageInputButton) {
                    messageInputButton.click();
                }
            }
        }
     
        // Create a MutationObserver to retrigger on hashchange
        const observer = new MutationObserver(() => {
            console.log('Hashchange event detected. Retriggering script.');
            clickChatAndMessageInput();
        });
     
        // Configure and start observing changes to the URL hash
        const config = { childList: true, subtree: true };
        observer.observe(document.body, config);
     
        // Initial click and observe hashchange
        setTimeout(function() {
            clickChatAndMessageInput();
        }, 1000);
    })();