Greasy Fork is available in English.

Additional script for Firewall

Additional script for Firewall to Reload the page if HCaptcha is detected, handle Turnstile and reCAPTCHA on Firewall

2024-12-20 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

  1. // ==UserScript==
  2. // @name Additional script for Firewall
  3. // @namespace Tamper & Violent & Others Monkey
  4. // @version 0.2
  5. // @description Additional script for Firewall to Reload the page if HCaptcha is detected, handle Turnstile and reCAPTCHA on Firewall
  6. // @author Ojo Ngono
  7. // @match https://faucetme.xyz/firewall
  8. // @match https://claim.ourcoincash.xyz/firewall
  9. // @icon https://i.ibb.co.com/XJSPdz0/large.png
  10. // @grant none
  11. // @license Copyright OjoNgono
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. // Fungsi untuk mengecek keberadaan HCaptcha
  18. function detectHCaptcha() {
  19. let hcaptchaFrame = document.querySelector("iframe[src*='hcaptcha.com']");
  20. return !!hcaptchaFrame; // Mengembalikan true jika HCaptcha ditemukan
  21. }
  22.  
  23. // Fungsi untuk mengecek Turnstile
  24. function checkTurnstile() {
  25. let turnstileResponse = document.querySelector('input[name="cf-turnstile-response"]');
  26. return turnstileResponse && turnstileResponse.value !== '';
  27. }
  28.  
  29. // Fungsi untuk mengecek reCAPTCHA
  30. function checkRecaptcha() {
  31. let recaptchaFrame = document.querySelector("iframe[title='reCAPTCHA']");
  32. if (recaptchaFrame) {
  33. return window.grecaptcha && window.grecaptcha.getResponse().length !== 0;
  34. }
  35. return false;
  36. }
  37.  
  38. // Fungsi untuk mengklik tombol Unlock
  39. function clickUnlock() {
  40. let unlockButton = document.querySelector('button.btn.btn-primary.w-md');
  41. if (unlockButton && unlockButton.innerText.includes('Unlock')) {
  42. console.log("Captcha resolved! Clicking Unlock button...");
  43. unlockButton.click();
  44. }
  45. }
  46.  
  47. // Tambahkan event listener untuk memantau perubahan pada DOM
  48. window.addEventListener("load", () => {
  49. console.log("Page fully loaded. Starting checks...");
  50. // Interval untuk mengecek kondisi setiap 2 detik
  51. setInterval(() => {
  52. if (detectHCaptcha()) {
  53. console.log("HCaptcha detected!");
  54. // Optional: Tambahkan log atau tindakan lain selain reload
  55. } else if (checkTurnstile() || checkRecaptcha()) {
  56. clickUnlock(); // Klik tombol jika captcha lain terselesaikan
  57. }
  58. }, 2000);
  59. });
  60.  
  61. // Pantau perubahan DOM untuk elemen dinamis
  62. const observer = new MutationObserver(() => {
  63. console.log("DOM mutation detected. Rechecking...");
  64. if (checkTurnstile() || checkRecaptcha()) {
  65. clickUnlock();
  66. }
  67. });
  68.  
  69. // Mulai observer pada body
  70. observer.observe(document.body, { childList: true, subtree: true });
  71. })();