Auto Click "I'm not a robot"

Automatically clicks the "I'm not a robot" checkbox

目前为 2024-05-14 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Auto Click "I'm not a robot"
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Automatically clicks the "I'm not a robot" checkbox
  6. // @author JJJ
  7. // @match *://*/*
  8. // @icon https://pngimg.com/uploads/robot/robot_PNG96.png
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. // Define the element selector and delay between clicks (in milliseconds)
  17. var elementSelector = 'input[type="button"]';
  18. var delayBetweenClicks = 1000; // in milliseconds
  19.  
  20. // Define the sleep function that pauses the script for a specified amount of time
  21. function sleep(ms) {
  22. return new Promise(resolve => setTimeout(resolve, ms));
  23. }
  24.  
  25. // Define the clickOnElements function that clicks on all elements that match a given selector
  26. async function clickOnElements(selector, delay) {
  27. var elements = document.querySelectorAll(selector);
  28. for (var i = 0; i < elements.length; i++) {
  29. elements[i].click();
  30. await sleep(delay); // Add a delay between each click
  31. }
  32. }
  33.  
  34. // Check if the start element exists on the page
  35. if (document.getElementById("start")) {
  36. // Call the clickOnElements function with the appropriate selector and delay values
  37. clickOnElements(elementSelector, delayBetweenClicks);
  38. } else {
  39. console.log("Start element not found.");
  40. }
  41. })();