Greasy Fork 支持简体中文。

New script uol.com.br

1/12/2025, 1:20:24 PM

  1. // ==UserScript==
  2. // @name New script uol.com.br
  3. // @namespace Violentmonkey Scripts
  4. // @match https://www.uol.com.br/*
  5. // @grant none
  6. // @version 1.0
  7. // @author -
  8. // @description 1/12/2025, 1:20:24 PM
  9. // @name pt-BR
  10. // ==/UserScript==
  11.  
  12. (function waitForButtonAndClick() {
  13. const observer = new MutationObserver((mutations, obs) => {
  14. const button = document.querySelector('button[aria-label="Fechar"]');
  15. if (button) {
  16. console.log('Button found:', button);
  17. button.click(); // Click the button
  18. console.log('Button clicked!');
  19. obs.disconnect(); // Stop observing once the button is clicked
  20. }
  21. });
  22.  
  23. // Start observing the document for changes
  24. observer.observe(document.body, {
  25. childList: true, // Observe direct children
  26. subtree: true // Observe all descendants
  27. });
  28.  
  29. console.log('Observer started, waiting for the button...');
  30. })();