🏠 返回首頁 

Greasy Fork is available in English.

Enable Disabled Checkbox

Позволяющий включить неактивный чекбокс 18+ на Rutube Studio.

  1. // ==UserScript==
  2. // @name Enable Disabled Checkbox
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description Позволяющий включить неактивный чекбокс 18+ на Rutube Studio.
  6. // @author Your Name
  7. // @match studio.rutube.ru/*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. // Function to enable the checkbox
  14. function enableCheckbox() {
  15. // Target the checkbox using its class and name attributes
  16. const checkboxWrapper = document.querySelector('.freyja_pen-checkbox__pen-checkbox_disabled_ImtFI');
  17. const checkbox = document.querySelector('input[name="adult"][id="adult"]');
  18. if (checkboxWrapper && checkbox) {
  19. // Remove the 'disabled' class and enable the checkbox
  20. checkboxWrapper.classList.remove('freyja_pen-checkbox__pen-checkbox_disabled_ImtFI');
  21. checkbox.removeAttribute('disabled');
  22. console.log('Checkbox enabled!');
  23. }
  24. }
  25. // Create a MutationObserver to watch for changes in the DOM
  26. const observer = new MutationObserver((mutations) => {
  27. mutations.forEach(() => {
  28. enableCheckbox();
  29. });
  30. });
  31. // Start observing the document body
  32. observer.observe(document.body, {
  33. childList: true,
  34. subtree: true
  35. });
  36. // Initial check in case the element is already loaded
  37. enableCheckbox();
  38. })();