CloudFlare Challenge

cloudflare

目前為 2024-05-10 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name CloudFlare Challenge
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description cloudflare
  6. // @author Keno Venas
  7. // @match https://challenges.cloudflare.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=cloudflare.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15. var fraseParaDetectar = "Confirme que é humano";
  16. function clicarComAtraso(botao) {
  17. setTimeout(function() {
  18. botao.click();
  19. }, 500);
  20. }
  21. function clicarQuandoDetectado() {
  22. var botao = document.querySelector('.cb-lb-t');
  23. if (botao) {
  24. clicarComAtraso(botao);
  25. }
  26. }
  27. var observer = new MutationObserver(function(mutations) {
  28. mutations.forEach(function(mutation) {
  29. if (mutation.type === 'childList') {
  30. var nodes = Array.from(mutation.addedNodes);
  31. nodes.forEach(function(node) {
  32. if (node.textContent.includes(fraseParaDetectar)) {
  33. clicarQuandoDetectado();
  34. }
  35. });
  36. }
  37. });
  38. });
  39. observer.observe(document.body, {
  40. childList: true,
  41. subtree: true
  42. });
  43. })();