Kick.com Enhancer

Kick.com Chat Overlay & Auto Unmute/1080p

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

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 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         Kick.com Enhancer
// @namespace    RishiSunak
// @version      0.3
// @description  Kick.com Chat Overlay & Auto Unmute/1080p
// @author       Rishi
// @match        https://kick.com/*
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    let currentStreamSrc = '';
    let overlayContainer = null;
 
    function checkStreamChange() {
        const videoElement = document.querySelector('video.vjs-tech');
        if (videoElement) {
            const newStreamSrc = videoElement.getAttribute('src');
            if (newStreamSrc !== currentStreamSrc) {
                currentStreamSrc = newStreamSrc;
                if (overlayContainer) {
                    overlayContainer.remove();
                }
 
                setTimeout(() => {
                    customizeVideo();
                    const match = window.location.pathname.match(/^\/(.+)$/);
                    if (match) {
                        const streamerName = match[1];
                        createOverlay(streamerName);
                    }
                }, 2000); 
            }
        }
    }
 
    function customizeVideo() {
        const muteControlButton = document.querySelector('.vjs-mute-control');
        if (muteControlButton) {
            const buttonText = muteControlButton.querySelector('.vjs-control-text').textContent.trim().toLowerCase();
 
            if (buttonText === 'unmute') {
                simulateClick(muteControlButton);
            }
        }
 
        // Set video quality to 1080p if available
        const qualityButtons = document.querySelectorAll('.vjs-menu-item-text');
        qualityButtons.forEach(button => {
            if (button.textContent.trim().toLowerCase() === '1080p60') {
                simulateClick(button);
            }
        });
 
        console.log('Video customized');
    }
 
    function createOverlay(streamerName) {
        const videoElement = document.getElementById('mifu-player-check');
        if (!videoElement) {
            return;
        }
 
        const overlay = document.createElement('div');
        overlay.style.position = 'absolute';
        overlay.style.bottom = '32px';
        overlay.style.left = '0';
        overlay.style.width = '100%';
        overlay.style.height = '40vh';
        overlay.style.zIndex = '9999';
        overlay.style.pointerEvents = 'none';
 
        const iframe = document.createElement('iframe');
        iframe.src = `https://cxwatcher.github.io/chat?user=${streamerName}&animate=true&badges=true&commands=true&bots=true&textsize=15px`;
        iframe.style.width = '100%';
        iframe.style.height = '100%';
        iframe.style.border = 'none';
 
        overlay.appendChild(iframe);
        videoElement.parentNode.appendChild(overlay);
 
        console.log('Overlay created');
        overlayContainer = document.getElementById('overlay-container');
    }
 
    function simulateClick(element) {
        var event = new MouseEvent('click', {
            bubbles: true,
            cancelable: true,
            view: window
        });
        element.dispatchEvent(event);
    }
 
    setTimeout(() => {
        checkStreamChange();
 
        setInterval(() => {
            checkStreamChange();
        }, 500);
    }, 2000);
})();