Kick.com Enhancer

Kick.com Chat Overlay & Auto Unmute/1080p

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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         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);
})();