Drawaria Keep Buttons Enabled

specific buttons remain enabled and clickable at all times

当前为 2024-12-27 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Drawaria Keep Buttons Enabled
// @namespace    http://tampermonkey.net/
// @version      2024-12-27
// @description  specific buttons remain enabled and clickable at all times
// @author       YouTube
// @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 mantener los botones habilitados
    function keepButtonsEnabled() {
        const buttons = document.querySelectorAll(
            'button.btn.btn-primary.btn-block.pgdrawbutton,' +
            'button.btn.btn-primary.btn-block.spawnavatarbutton,' +
            'button#sendtogallery'
        );
        buttons.forEach(button => {
            button.disabled = false;
            button.removeAttribute('disabled');
            button.style.pointerEvents = 'auto'; // Asegura que el botón sea clickeable
        });
    }

    // Ejecutar la función inicialmente
    keepButtonsEnabled();

    // Observar cambios en el DOM para mantener los botones habilitados
    const observer = new MutationObserver(keepButtonsEnabled);
    observer.observe(document.body, { childList: true, subtree: true, attributes: true });

    // También puedes agregar un intervalo para asegurarte de que los botones se mantengan habilitados
    setInterval(keepButtonsEnabled, 1000);

    // Interceptar el evento click para asegurar que los botones siempre estén habilitados
    document.addEventListener('click', function(event) {
        if (event.target && event.target.matches(
            'button.btn.btn-primary.btn-block.pgdrawbutton,' +
            'button.btn.btn-primary.btn-block.spawnavatarbutton,' +
            'button#sendtogallery'
        )) {
            event.target.disabled = false;
            event.target.removeAttribute('disabled');
            event.target.style.pointerEvents = 'auto';
        }
    }, true);
})();