Multi WEB PTC With AUTO Captcha

Multi PTC Cryptorotator

当前为 2022-12-22 提交的版本,查看 最新版本

此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/457009/1131008/Multi%20WEB%20PTC%20With%20AUTO%20Captcha.js

  1. // ==UserScript==
  2. // @name Multi WEB PTC With AUTO Captcha
  3. // @namespace Multi WEB PTC With AUTO Captcha
  4. // @version 1.0
  5. // @description Multi PTC Cryptorotator
  6. // @author Saputra
  7. // @match https://trxking.xyz/*
  8. // @match https://bitsfree.net/*
  9. // @match //https://free.shiba.limited/*
  10. // @match https://faucetoshi.com/*
  11. // @match https://claimcoin.in/*
  12. // @connect trxking.xyz
  13. // @connect bitsfree.net
  14. // @connect //free.shiba.limited
  15. // @connect faucetoshi.com
  16. // @connect claimcoin.in
  17. // @connect faucet4u.com
  18. // @noframes
  19. // @grant GM_xmlhttpRequest
  20. // @grant GM_setValue
  21. // @grant GM_getValue
  22.  
  23. // ==/UserScript==
  24. (function() {
  25.  
  26. 'use strict';
  27. window.alert = function() {};
  28. window.confirm = function() {};
  29.  
  30.  
  31. //Do not execute if window is a pop up
  32. if(window.name){
  33. return;
  34. }
  35.  
  36. var count = 0;
  37. var clicked = false;
  38.  
  39.  
  40. //Enter your login and password below, if you like to Autologin. Be careful while providing passwords,
  41. //else you may get your accounts locked
  42. var websiteData = [
  43.  
  44. {url : "https://trxking.xyz/ptc", login: "", password: ""},
  45. {url : "https://bitsfree.net/ptc", login: "", password: ""},
  46. {url : "https://free.shiba.limited/ptc", login: "", password: ""},
  47. {url : "https://faucetoshi.com/ptc", login: "", password: ""},
  48. {url : "https://claimcoin.in/ptc", login: "", password: ""},
  49. ];
  50.  
  51. var websiteMap = [{
  52.  
  53. website: "faucetoshi.com",
  54. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block.waves-effect"],
  55. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  56. captchaButtonSubmitSelector: ".modal-content .btn.btn-success.btn-block",
  57. allMessageSelectors: [".alert.alert-warning.text-center"],
  58. messagesToCheckBeforeMovingToNextUrl: ["There are currently no PTC ads available!"],
  59. additionalFunctions: grandcryptoauto,
  60. timeoutbeforeMovingToNextUrl: 50000
  61. },
  62.  
  63. {
  64. website: "ptcfaucet.xyz",
  65. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  66. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  67. captchaButtonSubmitSelector: [".btn.btn-success.btn-block", ".btn.btn-primary.btn-block"],
  68. allMessageSelectors: [".alert.alert-warning.text-center"],
  69. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  70. additionalFunctions: ptcfaucet,
  71. timeoutbeforeMovingToNextUrl: 120000
  72. },
  73.  
  74. {
  75. website: "metabitz.net",
  76. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  77. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  78. toggleCaptchaSelector:[".modal-body .form-control"],
  79. toggleCaptchaSelectorIndex: 1,
  80. captchaButtonSubmitSelector: [".btn.btn-success.btn-block", ".btn.btn-primary.btn-block"],
  81. allMessageSelectors: [".alert.alert-warning.text-center"],
  82. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  83. additionalFunctions: ptcfaucet,
  84. timeoutbeforeMovingToNextUrl: 120000
  85. },
  86.  
  87. {
  88. website: "dinntoks.com",
  89. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  90. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  91. toggleCaptchaSelector:[".modal-body .form-control"],
  92. toggleCaptchaSelectorIndex: 1,
  93. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  94. allMessageSelectors: [".alert.alert-warning.text-center"],
  95. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  96. additionalFunctions: dinntoks,
  97. timeoutbeforeMovingToNextUrl: 120000
  98. },
  99.  
  100. {
  101. website: "paidsatoshi.com",
  102. defaultButtonSelectors: [".card.card-hover .btn.waves-effect.waves-light.btn-rounded.btn-sm.btn-light.mt-2.pl-3.pr-3",".card-body .btn.btn-success.mt-2",".card-body .btn.btn-success.float-right"],
  103. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  104. allMessageSelectors: [".alert.alert-warning.text-center"],
  105. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  106. additionalFunctions: paidsatoshi,
  107. timeoutbeforeMovingToNextUrl: 120000
  108. },
  109.  
  110. {
  111. website: ["adbtc.io"],
  112. defaultButtonSelectors: [".mb-0.float-right .btn.btn-primary.btn-go"],
  113. allMessageSelectors: [".display-4.bg-white.text-center.p-2"],
  114. messagesToCheckBeforeMovingToNextUrl: ["Sorry, there are no new ads available."],
  115. additionalFunctions: adbtc,
  116. timeoutbeforeMovingToNextUrl: 120000
  117. },
  118.  
  119. {
  120. website: "trxking.xyz",
  121. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  122. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  123. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  124. allMessageSelectors: [".alert.alert-warning.text-center"],
  125. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  126. additionalFunctions: trxking,
  127. timeoutbeforeMovingToNextUrl: 120000
  128. },
  129.  
  130. {
  131. website: "auto.speedcoins.xyz",
  132. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  133. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  134. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  135. allMessageSelectors: [".alert.alert-warning.text-center"],
  136. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  137. additionalFunctions: speedcoins,
  138. timeoutbeforeMovingToNextUrl: 120000
  139. },
  140.  
  141. {
  142. website: ["madoge.fun","madtrx.fun","madfey.fun"],
  143. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  144. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  145. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  146. allMessageSelectors: [".alert.alert-warning.text-center"],
  147. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  148. additionalFunctions: mad,
  149. timeoutbeforeMovingToNextUrl: 120000
  150. },
  151.  
  152. {
  153. website: ["claimcoin.in"],
  154. defaultButtonSelectors: [".card .btn.btn-success.btn-block"],
  155. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  156. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  157. allMessageSelectors: [".alert.alert-warning.text-center"],
  158. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  159. additionalFunctions: mad,
  160. timeoutbeforeMovingToNextUrl: 120000
  161. },
  162.  
  163. {
  164. website: ["madltc.fun"],
  165. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  166. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  167. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  168. allMessageSelectors: [".alert.alert-warning.text-center"],
  169. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  170. additionalFunctions: mad,
  171. timeoutbeforeMovingToNextUrl: 120000
  172. },
  173.  
  174. {
  175. website: ["bitsfree.net"],
  176. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  177. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  178. captchaButtonSubmitSelector: [".btn.btn-success.btn-block.btn-sm"],
  179. allMessageSelectors: [".alert.alert-warning.text-center"],
  180. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  181. additionalFunctions: mad,
  182. timeoutbeforeMovingToNextUrl: 120000
  183. },
  184.  
  185. {
  186. website: ["free.shiba.limited"],
  187. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  188. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  189. captchaButtonSubmitSelector: [".btn.btn-success.btn-block"],
  190. allMessageSelectors: [".alert.alert-warning.text-center"],
  191. messagesToCheckBeforeMovingToNextUrl: ["There is PTC Ad left"],
  192. additionalFunctions: mad,
  193. timeoutbeforeMovingToNextUrl: 750000
  194. },
  195.  
  196. {
  197. website: ["dogeclick.io"],
  198. timeoutbeforeMovingToNextUrl: 2000
  199. },
  200.  
  201. ];
  202.  
  203.  
  204. //HtmlEvents dispatcher
  205. function triggerEvent(el, type) {
  206. try{
  207. var e = document.createEvent('HTMLEvents');
  208. e.initEvent(type, false, true);
  209. el.dispatchEvent(e);
  210. }catch(exception){
  211. console.log(exception);
  212. }
  213. }
  214.  
  215. function toggleCaptcha(selector, index){
  216. if( document.querySelector(selector)){
  217. document.querySelector(selector).selectedIndex = index;
  218. var targetNode = document.querySelector(selector);
  219. if (targetNode) {
  220. setTimeout(function() {
  221. triggerEvent(targetNode, 'change');
  222. }, 5000);
  223. }
  224. }
  225. }
  226.  
  227. //Check if a string is present in Array
  228. String.prototype.includesOneOf = function(arrayOfStrings) {
  229.  
  230. //If this is not an Array, compare it as a String
  231. if (!Array.isArray(arrayOfStrings)) {
  232. return this.toLowerCase().includes(arrayOfStrings.toLowerCase());
  233. }
  234.  
  235. for (var i = 0; i < arrayOfStrings.length; i++) {
  236. if (this.toLowerCase().includes(arrayOfStrings[i].toLowerCase())) {
  237. return true;
  238. }
  239. }
  240. return false;
  241. }
  242.  
  243. var websiteDataValues = {};
  244.  
  245. //Get selector details from the websiteMap
  246. for (let value of Object.values(websiteMap)) {
  247. if (window.location.href.includesOneOf(value.website)) {
  248. websiteDataValues.inputTextSelector = value.inputTextSelector;
  249. websiteDataValues.inputTextSelectorButton = value.inputTextSelectorButton;
  250. websiteDataValues.defaultButtonSelectors = value.defaultButtonSelectors;
  251. websiteDataValues.claimButtonSelector = value.claimButtonSelector;
  252. websiteDataValues.captchaButtonSubmitSelector = value.captchaButtonSubmitSelector;
  253. websiteDataValues.loginSelectors = value.loginSelectors;
  254. websiteDataValues.loginCaptcha = value.loginCaptcha;
  255. websiteDataValues.allMessageSelectors = value.allMessageSelectors;
  256. websiteDataValues.messagesToCheckBeforeMovingToNextUrl = value.messagesToCheckBeforeMovingToNextUrl;
  257. websiteDataValues.withdrawPageUrl = value.withdrawPageUrl;
  258. websiteDataValues.withdrawEnabled = value.withdrawEnabled;
  259. websiteDataValues.balanceSelector = value.balanceSelector;
  260. websiteDataValues.withdrawMinAmount = value.withdrawMinAmount;
  261. websiteDataValues.successMessageSelectors = value.successMessageSelectors;
  262. websiteDataValues.toggleCaptchaSelector = value.toggleCaptchaSelector;
  263. websiteDataValues.toggleCaptchaSelectorIndex = value.toggleCaptchaSelectorIndex;
  264. websiteDataValues.additionalFunctions = value.additionalFunctions;
  265. websiteDataValues.timeoutbeforeMovingToNextUrl = value.timeoutbeforeMovingToNextUrl;
  266. break;
  267. }
  268. }
  269.  
  270.  
  271. var login = "";
  272. var password = "";
  273.  
  274. for (let value of Object.values(websiteData)) {
  275. count = count + 1;
  276. if (value.url.includes(window.location.hostname)) {
  277. websiteDataValues.url = value.url;
  278. login = value.login;
  279. password = value.password;
  280. break;
  281. }
  282. }
  283.  
  284.  
  285. //Get the next Url from the website data map
  286. async function getNextUrl() {
  287.  
  288. //Go to the beginning if the end of the array is reached
  289. if (count >= websiteData.length) {
  290. websiteDataValues.nextUrl = websiteData[0].url;
  291. } else {
  292. websiteDataValues.nextUrl = websiteData[count].url;
  293. }
  294.  
  295. //Use case for overrding next Url
  296. if (websiteDataValues.overrideNextUrl) {
  297. websiteDataValues.nextUrl = websiteDataValues.overrideNextUrl;
  298. }
  299.  
  300. //Ping Test to check if a website is up before proceeding to next url
  301. pingTest(websiteDataValues.nextUrl);
  302. }
  303.  
  304. var isNextUrlReachable = false;
  305. //Get the next Url from the website
  306. function pingTest(websiteUrl) {
  307. console.log(websiteUrl);
  308. GM_xmlhttpRequest({
  309. method: "GET",
  310. url: websiteUrl,
  311. headers: {
  312. "Content-Type": "application/x-www-form-urlencoded"
  313. },
  314. timeout: 5000,
  315. onload: function(response) {
  316. //Website is reachable
  317. isNextUrlReachable = true;
  318. },
  319. onerror: function(e) {
  320. count = count + 1;
  321. getNextUrl();
  322. },
  323. ontimeout: function() {
  324. count = count + 1;
  325. getNextUrl();
  326. },
  327. });
  328.  
  329. }
  330.  
  331.  
  332. async function delay(ms) {
  333. return new Promise(resolve => setTimeout(resolve, ms))
  334. }
  335.  
  336.  
  337. var movingToNextUrl = false;
  338. async function goToNextUrl() {
  339. if (!movingToNextUrl) {
  340. movingToNextUrl = true;
  341. getNextUrl();
  342. while (!isNextUrlReachable) {
  343. await delay(3000);
  344. }
  345. window.location.href = websiteDataValues.nextUrl;
  346. }
  347. }
  348.  
  349.  
  350. //Default Setting: After 1000 seconds go to next Url
  351. var delayBeforeMovingToNextUrl = 1000000;
  352. if (websiteDataValues.timeoutbeforeMovingToNextUrl) {
  353. delayBeforeMovingToNextUrl = websiteDataValues.timeoutbeforeMovingToNextUrl;
  354. }
  355.  
  356. setTimeout(function() {
  357. goToNextUrl();
  358. }, delayBeforeMovingToNextUrl);
  359.  
  360.  
  361. //Wait for 5 seconds if it's in dashboard,
  362. if ((!window.location.href.includes("coinpayu")) && (window.location.href.includes("dashboard") || window.location.href.includes("page/user-admin"))) {
  363. setTimeout(function() {
  364. if (websiteDataValues.url) {
  365. window.location.href = websiteDataValues.url;
  366. }
  367. }, 5000);
  368. }
  369.  
  370.  
  371. //Returns true if message selectors are present
  372. function messageSelectorsPresent() {
  373. if (websiteDataValues.allMessageSelectors) {
  374. for (var j = 0; j < websiteDataValues.allMessageSelectors.length; j++) {
  375. for (var k = 0; k < document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length; k++) {
  376. if (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
  377. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl) ||
  378. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
  379. document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)))) {
  380. return true;
  381. }
  382. }
  383. }
  384. }
  385. return false;
  386. }
  387.  
  388. function closeRepeatingAds() {
  389.  
  390. //Check if previous Ad is Same as Current Ad and Skip the Ad
  391. if (unsafeWindow.viewurl) {
  392. if (GM_getValue("adUrl") && GM_getValue("adUrl") == unsafeWindow.viewurl) {
  393. //Skip the Ad
  394. document.querySelector(".card > a").click();
  395. movingToNextUrl = true;
  396. } else {
  397. GM_setValue("adUrl", unsafeWindow.viewurl);
  398. }
  399.  
  400. }
  401.  
  402. }
  403.  
  404.  
  405.  
  406. function grandcryptoauto() {
  407.  
  408. //Block Pop Ups
  409. unsafeWindow.open = function(){};
  410.  
  411. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  412. window.location.href = "https://faucetoshi.com/ptc/";
  413. }
  414.  
  415. }
  416.  
  417. function ptcfaucet() {
  418.  
  419. //Block Pop Ups
  420. unsafeWindow.open = function(){};
  421.  
  422. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  423. window.location.href = "https://ptcfaucet.xyz/ptc/";
  424. }
  425.  
  426. }
  427.  
  428. function metabitz() {
  429.  
  430. //Block Pop Ups
  431. unsafeWindow.open = function(){};
  432.  
  433. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  434. window.location.href = "https://metabitz.net/ptc/";
  435. }
  436.  
  437. }
  438.  
  439. function dinntoks() {
  440.  
  441. //Block Pop Ups
  442. unsafeWindow.open = function(){};
  443.  
  444. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  445. window.location.href = "https://dinntoks.com/ptc/";
  446. }
  447.  
  448. }
  449.  
  450. function paidsatoshi() {
  451.  
  452. //Block Pop Ups
  453. unsafeWindow.open = function(){};
  454.  
  455. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  456. window.location.href = "https://https://paidsatoshi.com/surfads.php/";
  457. }
  458.  
  459. }
  460.  
  461. function adbtc() {
  462.  
  463. //Block Pop Ups
  464. unsafeWindow.open = function(){};
  465.  
  466. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  467. window.location.href = "https://adbtc.io/surf/";
  468. }
  469.  
  470. }
  471.  
  472. function trxking() {
  473.  
  474. //Block Pop Ups
  475. unsafeWindow.open = function(){};
  476.  
  477. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  478. window.location.href = "https://trxking.xyz/ptc/";
  479. }
  480.  
  481. }
  482.  
  483. function speedcoins() {
  484.  
  485. //Block Pop Ups
  486. unsafeWindow.open = function(){};
  487.  
  488. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  489. window.location.href = "https://auto.speedcoins.xyz/ptc/";
  490. }
  491.  
  492. }
  493.  
  494. function mad() {
  495.  
  496. //Block Pop Ups
  497. unsafeWindow.open = function(){};
  498.  
  499. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  500. window.location.href = ["https://madoge.fun/ptc/","https://madtrx.fun/ptc/","https://madfey.fun/ptc/","https://madshiba.fun/ptc/","https://bitsfree.net/ptc/","https://free.shiba.limited/ptc/","https://madltc.fun/ptc/"];
  501. }
  502.  
  503. }
  504.  
  505.  
  506. var stopSolvingCaptcha = false;
  507.  
  508. function checkLoginSelectors() {
  509.  
  510. if (websiteDataValues.loginSelectors) {
  511. //Check if all login selectors are present
  512. let count = 0;
  513. for (let i = 0; i < websiteDataValues.loginSelectors.length; i++) {
  514. if (document.querySelector(websiteDataValues.loginSelectors[i])) {
  515. count++;
  516. }
  517.  
  518. }
  519.  
  520. if (count == websiteDataValues.loginSelectors.length) {
  521.  
  522. if (login.length > 0 && password.length > 0) {
  523. //Input Login
  524. document.querySelector(websiteDataValues.loginSelectors[0]).value = login;
  525.  
  526. //Input Password
  527. document.querySelector(websiteDataValues.loginSelectors[1]).value = password;
  528. } else {
  529. stopSolvingCaptcha = true;
  530. }
  531.  
  532. } else {
  533. stopSolvingCaptcha = true;
  534. }
  535.  
  536. } else {
  537. stopSolvingCaptcha = true;
  538. }
  539.  
  540. }
  541.  
  542.  
  543. setTimeout(function() {
  544.  
  545. checkLoginSelectors();
  546.  
  547. if (websiteDataValues.additionalFunctions) {
  548. websiteDataValues.additionalFunctions();
  549. }
  550.  
  551. //Look for all the default messages or errors before proceeding to next url
  552. //For other languages difference in the length of the strings can be compared or visibility of the style element
  553. if (!movingToNextUrl && messageSelectorsPresent()) {
  554. goToNextUrl();
  555. }
  556.  
  557.  
  558. //Check for all the default button selectors and click
  559. //This will only click the first selector found, so mention the selectors with parent element wherever required
  560. if(!movingToNextUrl && websiteDataValues.defaultButtonSelectors){
  561. for(var i=0;i<websiteDataValues.defaultButtonSelectors.length ;i++){
  562. if(document.querySelector(websiteDataValues.defaultButtonSelectors[i])){
  563. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mousedown');
  564. triggerEvent(document.querySelector(websiteDataValues.defaultButtonSelectors[i]), 'mouseup');
  565. document.querySelector(websiteDataValues.defaultButtonSelectors[i]).click();
  566. break;
  567. }
  568. }
  569. }
  570.  
  571. if(!movingToNextUrl && websiteDataValues.toggleCaptchaSelector && Number.isInteger(websiteDataValues.toggleCaptchaSelectorIndex)){
  572. toggleCaptcha(websiteDataValues.toggleCaptchaSelector,websiteDataValues.toggleCaptchaSelectorIndex);
  573. }
  574.  
  575. //Input the address and click the login button
  576. if (!movingToNextUrl && document.querySelector(websiteDataValues.inputTextSelector)) {
  577. document.querySelector(websiteDataValues.inputTextSelector).value = websiteDataValues.address;
  578. setTimeout(function() {
  579. if (websiteDataValues.inputTextSelectorButton && document.querySelector(websiteDataValues.inputTextSelectorButton)) {
  580. document.querySelector(websiteDataValues.inputTextSelectorButton).click();
  581. }
  582.  
  583. }, 5000);
  584. }
  585.  
  586. //Click the form button after solving captcha
  587. //Works for both recaptcha and hcaptcha
  588. var clicked = false;
  589. var captchaInterval = setInterval(function() {
  590. if (!stopSolvingCaptcha || !window.location.href.includes("login")) {
  591. try {
  592. if (!clicked && unsafeWindow.grecaptcha && unsafeWindow.grecaptcha.getResponse().length > 0) {
  593. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  594. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  595. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  596. }
  597. }
  598. clicked = true;
  599.  
  600. clearInterval(captchaInterval);
  601. setTimeout(function() {
  602. if (messageSelectorsPresent()) {
  603. goToNextUrl();
  604. }
  605. }, 5000);
  606. }
  607. } catch (e) {
  608.  
  609. }
  610.  
  611. for (var hc = 0; hc < document.querySelectorAll("iframe").length; hc++) {
  612. if (!clicked && document.querySelectorAll("iframe")[hc] &&
  613. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response") &&
  614. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response").length > 0) {
  615. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  616. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  617. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  618. }
  619. }
  620. clicked = true;
  621. clearInterval(captchaInterval);
  622. setTimeout(function() {
  623. if (messageSelectorsPresent()) {
  624. goToNextUrl();
  625. }
  626. }, 5000);
  627. }
  628. }
  629. }
  630.  
  631. }, 5000);
  632.  
  633.  
  634. }, 5000);
  635.  
  636.  
  637. window.onbeforeunload = function() {
  638. if (unsafeWindow.myWindow) {
  639. unsafeWindow.myWindow.close();
  640. }
  641. if (unsafeWindow.coinwin) {
  642. var tmp = unsafeWindow.coinwin;
  643. unsafeWindow.coinwin = {};
  644. tmp.close();
  645. }
  646.  
  647. };
  648.  
  649. })();