Drawaria Enhanced Ratedrawerbox

Mantiene el elemento #ratedrawerbox siempre visible, activo y clickeable, incluso si estás prohibido de dibujar, y permite su reutilización

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Drawaria Enhanced Ratedrawerbox
// @namespace    http://tampermonkey.net/
// @version      2024-12-28
// @description  Mantiene el elemento #ratedrawerbox siempre visible, activo y clickeable, incluso si estás prohibido de dibujar, y permite su reutilización
// @author       YouTubeDrawaria
// @match        https://drawaria.online/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
// @grant       none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Función para asegurar que #ratedrawerbox esté siempre visible y activo
    function ensureRatedrawerboxVisibility() {
        const ratedrawerbox = document.getElementById('ratedrawerbox');
        if (ratedrawerbox) {
            ratedrawerbox.style.display = 'block';
            ratedrawerbox.style.visibility = 'visible';
            ratedrawerbox.style.pointerEvents = 'auto';
        }
    }

    // Función para interceptar y modificar el comportamiento del botón ratedrawerbox
    function interceptRatedrawerboxButton() {
        const ratedrawerboxButton = document.querySelector('.ratedrawerbox-button');
        if (ratedrawerboxButton) {
            ratedrawerboxButton.style.display = 'block';
            ratedrawerboxButton.style.visibility = 'visible';
            ratedrawerboxButton.style.pointerEvents = 'auto';

            ratedrawerboxButton.addEventListener('click', function() {
                // Forzar el uso del ratedrawerbox
                window.Hr("sendratedraw");
                window.Po(window.h, "ratedrawerbox", 60);

                // Restablecer el ratedrawerbox a su estado original después de un breve retraso
                setTimeout(function() {
                    const ratedrawerbox = document.getElementById('ratedrawerbox');
                    if (ratedrawerbox) {
                        ratedrawerbox.style.display = 'block';
                        ratedrawerbox.style.visibility = 'visible';
                        ratedrawerbox.style.pointerEvents = 'auto';
                    }
                }, 100); // Ajusta el retraso según sea necesario
            });

            // Asegurar que el evento de clic se detecte correctamente
            ratedrawerboxButton.click();
        }
    }

    // Función principal para ejecutar todas las funciones
    function enhanceRatedrawerbox() {
        ensureRatedrawerboxVisibility();
        interceptRatedrawerboxButton();
    }

    // Ejecutar la función principal inicialmente
    enhanceRatedrawerbox();

    // Observar cambios en el DOM para mantener el ratedrawerbox visible y activo
    const observer = new MutationObserver(enhanceRatedrawerbox);
    observer.observe(document.body, { childList: true, subtree: true, attributes: true });

    // También puedes agregar un intervalo para asegurarte de que el ratedrawerbox se mantenga visible/activo
    setInterval(enhanceRatedrawerbox, 1000);
})();