Drawaria Keep Buttons Enabled

specific buttons remain enabled and clickable at all times

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

  1. // ==UserScript==
  2. // @name Drawaria Keep Buttons Enabled
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-12-27
  5. // @description specific buttons remain enabled and clickable at all times
  6. // @author YouTube
  7. // @match https://drawaria.online/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=drawaria.online
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // Función para mantener los botones habilitados
  17. function keepButtonsEnabled() {
  18. const buttons = document.querySelectorAll(
  19. 'button.btn.btn-primary.btn-block.pgdrawbutton,' +
  20. 'button.btn.btn-primary.btn-block.spawnavatarbutton,' +
  21. 'button#sendtogallery'
  22. );
  23. buttons.forEach(button => {
  24. button.disabled = false;
  25. button.removeAttribute('disabled');
  26. button.style.pointerEvents = 'auto'; // Asegura que el botón sea clickeable
  27. });
  28. }
  29.  
  30. // Ejecutar la función inicialmente
  31. keepButtonsEnabled();
  32.  
  33. // Observar cambios en el DOM para mantener los botones habilitados
  34. const observer = new MutationObserver(keepButtonsEnabled);
  35. observer.observe(document.body, { childList: true, subtree: true, attributes: true });
  36.  
  37. // También puedes agregar un intervalo para asegurarte de que los botones se mantengan habilitados
  38. setInterval(keepButtonsEnabled, 1000);
  39.  
  40. // Interceptar el evento click para asegurar que los botones siempre estén habilitados
  41. document.addEventListener('click', function(event) {
  42. if (event.target && event.target.matches(
  43. 'button.btn.btn-primary.btn-block.pgdrawbutton,' +
  44. 'button.btn.btn-primary.btn-block.spawnavatarbutton,' +
  45. 'button#sendtogallery'
  46. )) {
  47. event.target.disabled = false;
  48. event.target.removeAttribute('disabled');
  49. event.target.style.pointerEvents = 'auto';
  50. }
  51. }, true);
  52. })();