Additional script for Firewall

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

Verze ze dne 23. 12. 2024. Zobrazit nejnovější verzi.

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