CryptoSite Redirect To earn

CryptoSite Redirect To earn (auto redirect and earn)

当前为 2022-02-25 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name CryptoSite Redirect To earn
  3. // @namespace CryptoSite Redirect To earn
  4. // @description CryptoSite Redirect To earn (auto redirect and earn)
  5. // @version 0.1.0
  6. // @author Tomek
  7. // @match https://www.coinpayu.com/*
  8. // @match https://adbtc.top/*
  9. // @match https://adbch.top/*
  10. // @match https://adltc.cc/*
  11. // @match https://faucetpay.io/*
  12. // @match https://everve.net/*
  13. // @connect www.coinpayu.com
  14. // @connect adbtc.top
  15. // @connect adbch.top
  16. // @connect adltc.cc
  17. // @connect faucetpay.io
  18. // @noframes
  19. // @grant GM_xmlhttpRequest
  20. // @grant GM_setValue
  21. // @grant GM_getValue
  22. // ==/UserScript==
  23. (function() {
  24.  
  25. 'use strict';
  26. window.alert = function() {};
  27. window.confirm = function() {};
  28. //Do not execute if window is a pop up
  29. if(window.name){
  30. return;
  31. }
  32.  
  33. var count = 0;
  34. var clicked = false;
  35.  
  36.  
  37. //Enter your login and password below, if you like to Autologin. Be careful while providing passwords,
  38. //else you may get your accounts locked
  39. var websiteData = [
  40. {url : "https://www.coinpayu.com/dashboard/ads_surf", login: "", password: ""},
  41. {url : "https://adbtc.top/index/earn", login: "", password: ""},
  42. {url : "https://adbch.top/surf/browse", login: "", password: ""},
  43. {url : "https://adltc.cc/surf", login: "", password: ""},
  44. {url : "https://adeth.cc/surf", login: "", password: ""},
  45. {url : "https://addoge.cc/surf", login: "", password: ""},
  46. {url : "https://adzec.cc/surf", login: "", password: ""},
  47. {url : "https://adxrp.cc/surf", login: "", password: ""},
  48. {url : "https://addash.cc/surf", login: "", password: ""},
  49. {url : "https://www.adbch.cc/surf", login: "", password: ""},
  50. {url : "https://adsdgb.com/surf", login: "", password: ""},
  51. {url : "https://surf-trx.com/surf", login: "", password: ""},
  52. {url : "https://faucetpay.io/ptc", login: "", password: ""},
  53. {url : "https://everve.net/tasks/traffic-exchange/", login: "", password: ""},
  54. ];
  55.  
  56. var websiteMap = [
  57. //first site (start)
  58. {
  59. website: "coinpayu.com",
  60. defaultButtonSelectors: [".btn.btn-primary.btn-large"],
  61. loginSelectors: ["input[type=email]", "input[type=password]", "body > div:nth-child(1) > div > main > div > button"],
  62. captchaButtonSubmitSelector: [".btn.btn-default", "input[type=submit]"],
  63. allMessageSelectors: ["p.flow-text", "#pre > p"],
  64. additionalFunctions: coinpayu,
  65. messagesToCheckBeforeMovingToNextUrl: ["You have watched", "Links in surfing are over"],
  66. timeoutbeforeMovingToNextUrl: 500000
  67. },
  68. //2
  69. {
  70. website: "adbtc.top",
  71. defaultButtonSelectors: [".btn.btn-primary.btn-large"],
  72. loginSelectors: ["input[type=text]", "input[type=password]", "input[type=submit]"],
  73. captchaButtonSubmitSelector: [".btn.btn-default", "input[type=submit]"],
  74. allMessageSelectors: ["p.flow-text", "#pre > p"],
  75. additionalFunctions: adbtcTop,
  76. messagesToCheckBeforeMovingToNextUrl: ["You have watched", "Links in surfing are over"]
  77. },
  78. //3
  79. {
  80. website: "adltc.cc",
  81. defaultButtonSelectors: ["#index-banner .btn-large", ".btn.btn-primary.btn-large"],
  82. loginSelectors: ["input[type=text]", "input[type=password]", ".btn.btn-default"],
  83. captchaButtonSubmitSelector: [".btn.btn-default"],
  84. allMessageSelectors: ["h3", "#pre > p", "#cf-error-details"],
  85. additionalFunctions: closeRepeatingAds,
  86. messagesToCheckBeforeMovingToNextUrl: ["No ads", "Links in surfing are over", "Error 520"]
  87. },
  88.  
  89. {
  90. website: "adbch.top",
  91. defaultButtonSelectors: ["#btstart"],
  92. loginSelectors: ["#mail", "#password", ".btn-large"],
  93. captchaButtonSubmitSelector: [".btn.btn-default", ".btn-large"],
  94. allMessageSelectors: ["h5"],
  95. additionalFunctions: adbtcTop,
  96. messagesToCheckBeforeMovingToNextUrl: ["You have looked at all the sites at the moment"]
  97. },
  98. {
  99. //Again ADBTC its important to check again
  100. website: "adbtc.top",
  101. defaultButtonSelectors: [".btn.btn-primary.btn-large"],
  102. loginSelectors: ["input[type=text]", "input[type=password]", "input[type=submit]"],
  103. captchaButtonSubmitSelector: [".btn.btn-default", "input[type=submit]"],
  104. allMessageSelectors: ["p.flow-text", "#pre > p"],
  105. additionalFunctions: adbtcTop,
  106. messagesToCheckBeforeMovingToNextUrl: ["You have watched", "Links in surfing are over"]
  107. },
  108.  
  109. {
  110. website: "faucetpay.io",
  111. defaultButtonSelectors: [".card-body .btn.btn-primary.btn-block"],
  112. loginSelectors: ["input[type=text]", "input[type=password]", "button[type=submit]"],
  113. captchaButtonSubmitSelector: [".btn.btn-lg.btn-danger", ".btn.btn-primary.btn-block"],
  114. allMessageSelectors: [".alert.alert-info"],
  115. messagesToCheckBeforeMovingToNextUrl: ["There are no ads available"],
  116. additionalFunctions: faucetpay,
  117. timeoutbeforeMovingToNextUrl: 380000
  118. },
  119.  
  120.  
  121.  
  122.  
  123. ];
  124.  
  125.  
  126. //Check if a string is present in Array
  127. String.prototype.includesOneOf = function(arrayOfStrings) {
  128.  
  129. //If this is not an Array, compare it as a String
  130. if (!Array.isArray(arrayOfStrings)) {
  131. return this.toLowerCase().includes(arrayOfStrings.toLowerCase());
  132. }
  133.  
  134. for (var i = 0; i < arrayOfStrings.length; i++) {
  135. if (this.toLowerCase().includes(arrayOfStrings[i].toLowerCase())) {
  136. return true;
  137. }
  138. }
  139. return false;
  140. }
  141.  
  142.  
  143.  
  144. var websiteDataValues = {};
  145.  
  146. //Get selector details from the websiteMap
  147. for (let value of Object.values(websiteMap)) {
  148. if (window.location.href.includesOneOf(value.website)) {
  149. websiteDataValues.inputTextSelector = value.inputTextSelector;
  150. websiteDataValues.inputTextSelectorButton = value.inputTextSelectorButton;
  151. websiteDataValues.defaultButtonSelectors = value.defaultButtonSelectors;
  152. websiteDataValues.claimButtonSelector = value.claimButtonSelector;
  153. websiteDataValues.captchaButtonSubmitSelector = value.captchaButtonSubmitSelector;
  154. websiteDataValues.loginSelectors = value.loginSelectors;
  155. websiteDataValues.loginCaptcha = value.loginCaptcha;
  156. websiteDataValues.allMessageSelectors = value.allMessageSelectors;
  157. websiteDataValues.messagesToCheckBeforeMovingToNextUrl = value.messagesToCheckBeforeMovingToNextUrl;
  158. websiteDataValues.withdrawPageUrl = value.withdrawPageUrl;
  159. websiteDataValues.withdrawEnabled = value.withdrawEnabled;
  160. websiteDataValues.balanceSelector = value.balanceSelector;
  161. websiteDataValues.withdrawMinAmount = value.withdrawMinAmount;
  162. websiteDataValues.successMessageSelectors = value.successMessageSelectors;
  163. websiteDataValues.additionalFunctions = value.additionalFunctions;
  164. websiteDataValues.timeoutbeforeMovingToNextUrl = value.timeoutbeforeMovingToNextUrl;
  165. break;
  166. }
  167. }
  168.  
  169.  
  170. var login = "";
  171. var password = "";
  172.  
  173. for (let value of Object.values(websiteData)) {
  174. count = count + 1;
  175. if (value.url.includes(window.location.hostname)) {
  176. websiteDataValues.url = value.url;
  177. login = value.login;
  178. password = value.password;
  179. break;
  180. }
  181. }
  182.  
  183.  
  184. //Get the next Url from the website data map
  185. async function getNextUrl() {
  186.  
  187. //Go to the beginning if the end of the array is reached
  188. if (count >= websiteData.length) {
  189. websiteDataValues.nextUrl = websiteData[0].url;
  190. } else {
  191. websiteDataValues.nextUrl = websiteData[count].url;
  192. }
  193.  
  194. //Use case for overrding next Url
  195. if (websiteDataValues.overrideNextUrl) {
  196. websiteDataValues.nextUrl = websiteDataValues.overrideNextUrl;
  197. }
  198.  
  199. //Ping Test to check if a website is up before proceeding to next url
  200. pingTest(websiteDataValues.nextUrl);
  201. }
  202.  
  203. var isNextUrlReachable = false;
  204. //Get the next Url from the website
  205. function pingTest(websiteUrl) {
  206. console.log(websiteUrl);
  207. GM_xmlhttpRequest({
  208. method: "GET",
  209. url: websiteUrl,
  210. headers: {
  211. "Content-Type": "application/x-www-form-urlencoded"
  212. },
  213. timeout: 5000,
  214. onload: function(response) {
  215. //Website is reachable
  216. isNextUrlReachable = true;
  217. },
  218. onerror: function(e) {
  219. count = count + 1;
  220. getNextUrl();
  221. },
  222. ontimeout: function() {
  223. count = count + 1;
  224. getNextUrl();
  225. },
  226. });
  227.  
  228. }
  229.  
  230.  
  231. async function delay(ms) {
  232. return new Promise(resolve => setTimeout(resolve, ms))
  233. }
  234.  
  235.  
  236. var movingToNextUrl = false;
  237. async function goToNextUrl() {
  238. if (!movingToNextUrl) {
  239. movingToNextUrl = true;
  240. getNextUrl();
  241. while (!isNextUrlReachable) {
  242. await delay(3000);
  243. }
  244. window.location.href = websiteDataValues.nextUrl;
  245. }
  246. }
  247.  
  248.  
  249. //Default Setting: After 180 seconds go to next Url
  250. var delayBeforeMovingToNextUrl = 180000;
  251. if (websiteDataValues.timeoutbeforeMovingToNextUrl) {
  252. delayBeforeMovingToNextUrl = websiteDataValues.timeoutbeforeMovingToNextUrl;
  253. }
  254.  
  255. setTimeout(function() {
  256. goToNextUrl();
  257. }, delayBeforeMovingToNextUrl);
  258.  
  259.  
  260. //Wait for 5 seconds if it's in dashboard,
  261. if ((!window.location.href.includes("coinpayu")) && (window.location.href.includes("dashboard") || window.location.href.includes("page/user-admin"))) {
  262. setTimeout(function() {
  263. if (websiteDataValues.url) {
  264. window.location.href = websiteDataValues.url;
  265. }
  266. }, 5000);
  267. }
  268.  
  269.  
  270. //Returns true if message selectors are present
  271. function messageSelectorsPresent() {
  272. if (websiteDataValues.allMessageSelectors) {
  273. for (var j = 0; j < websiteDataValues.allMessageSelectors.length; j++) {
  274. for (var k = 0; k < document.querySelectorAll(websiteDataValues.allMessageSelectors[j]).length; k++) {
  275. if (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k] &&
  276. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].innerText.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl) ||
  277. (document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value &&
  278. document.querySelectorAll(websiteDataValues.allMessageSelectors[j])[k].value.includesOneOf(websiteDataValues.messagesToCheckBeforeMovingToNextUrl)))) {
  279. return true;
  280. }
  281. }
  282. }
  283. }
  284. return false;
  285. }
  286.  
  287. function closeRepeatingAds() {
  288.  
  289. //Check if previous Ad is Same as Current Ad and Skip the Ad
  290. if (unsafeWindow.viewurl) {
  291. if (GM_getValue("adUrl") && GM_getValue("adUrl") == unsafeWindow.viewurl) {
  292. //Skip the Ad
  293. document.querySelector(".card > a").click();
  294. movingToNextUrl = true;
  295. } else {
  296. GM_setValue("adUrl", unsafeWindow.viewurl);
  297. }
  298.  
  299. }
  300.  
  301. }
  302.  
  303.  
  304. function adbtcTop() {
  305.  
  306. // For adbtc, special use case
  307. if (document.querySelector(".collection-item.hoverable") && document.querySelector(".collection-item.hoverable").innerText.includes("Sign in")) {
  308. document.querySelector(".collection-item.hoverable").click();
  309. }
  310.  
  311. for(let j=0; j<document.querySelectorAll(".dropdown-content.select-dropdown").length; j++){
  312. for(let i=0; i<document.querySelectorAll(".dropdown-content.select-dropdown")[j].getElementsByTagName("li").length; i++){
  313. if( document.querySelectorAll(".dropdown-content.select-dropdown")[j].getElementsByTagName("li")[i].innerText.includes("hCaptcha") &&
  314. !(document.querySelectorAll(".dropdown-content.select-dropdown")[j].getElementsByTagName("li")[i].getAttribute("class") &&
  315. document.querySelectorAll(".dropdown-content.select-dropdown")[j].getElementsByTagName("li")[i].getAttribute("class").includes("selected"))){
  316. document.querySelectorAll(".dropdown-content.select-dropdown")[j].getElementsByTagName("li")[i].click();
  317. break;
  318. }
  319. }
  320. }
  321.  
  322. if (document.querySelector("div.col.s4> a") && !document.querySelector("div.col.s4> a").className.includes("hide")) {
  323. document.querySelector("div.col.s4> a").click();
  324. }
  325.  
  326. if (window.location.href == "https://adbtc.top/index/" || window.location.href == "https://adbtc.top/index") {
  327. window.location.href = "https://adbtc.top/index/earn";
  328. }
  329.  
  330. if (window.location.href == "https://adbtc.top/index/earn" || window.location.href == "https://adbtc.top/index/earn/") {
  331. window.location.href = document.querySelectorAll(".collection.menu.colmen.nomarg > a")[0].href;
  332. }
  333.  
  334. //Use case for adbtc
  335. if (window.location.href.includes("adbtc.top/surf/browse")) {
  336. websiteDataValues.overrideNextUrl = document.querySelectorAll(".collection.menu.colmen.nomarg > a")[1].href;
  337. }
  338.  
  339. setInterval(function() {
  340. //Skip the Ad if the Ad closes on it's own for adbtc due to Adblocker or the script itself
  341. if (document.querySelector("#nenado") && !document.querySelector("#nenado").className.includes("hide") &&
  342. document.querySelector("#nenado").innerText.includes("You closed page")) {
  343. document.querySelector("#nenado > a").click();
  344. }
  345. }, 10000);
  346.  
  347. }
  348. function faucetpay() {
  349. //Block Pop Ups
  350. unsafeWindow.open = function(){};
  351.  
  352. if(document.querySelector("body").innerText.includes("This ad does not exist or has expired")){
  353. window.location.href = "https://faucetpay.io/ptc/";
  354. }
  355.  
  356. }
  357. function everve() {
  358. var oldfunction = unsafeWindow.open;
  359. var windowName = "";
  360.  
  361. function newFunction(params1, params2) {
  362.  
  363. console.log(params1 + params2);
  364. if (!params2 || params2 == "_blank") {
  365. windowName = "EvervepopUpWindow";
  366. } else {
  367. windowName = params2;
  368. }
  369.  
  370. return oldfunction(params1, windowName);
  371. };
  372.  
  373. unsafeWindow.open = newFunction;
  374.  
  375. unsafeWindow.onbeforeunload = function() {
  376. unsafeWindow.open('', windowName).close();
  377. };
  378.  
  379. var clicked = false;
  380. var interval = setInterval(function(){
  381.  
  382. if(document.querySelectorAll(".table_row[role=row]").length == 0){
  383. clearInterval(interval);
  384. goToNextUrl();
  385. return;
  386. }
  387.  
  388.  
  389. if(!clicked){
  390. for(let i=0; i< document.querySelectorAll(".table_row[role=row]").length;i++){
  391.  
  392. if(document.querySelectorAll(".table_row[role=row]")[i].style.display != "none"){
  393. document.querySelectorAll(".table_row[role=row] .btn-group")[i].querySelector("a").click();
  394. clicked = true;
  395. break;
  396. }
  397. }
  398. }else{
  399.  
  400. if( document.querySelector("#next_button").style.display != "none"){
  401. document.querySelector("#next_button > button").click();
  402. clicked = false;
  403. }
  404. }
  405.  
  406. },5000);
  407.  
  408. }
  409.  
  410.  
  411.  
  412. function coinpayu() {
  413.  
  414.  
  415. var oldfunction = unsafeWindow.open;
  416. var windowName = "";
  417.  
  418. function newFunction(params1, params2) {
  419.  
  420. console.log(params1 + params2);
  421. if (!params2 || params2 == "_blank") {
  422. windowName = "popUpWindow";
  423. } else {
  424. windowName = params2;
  425. }
  426. if (window.location.href == "https://www.coinpayu.com/dashboard/ads_active") {
  427. // opts = "height=800,width=800";
  428. }
  429.  
  430. console.log("WindowName is::" + windowName);
  431.  
  432. return oldfunction(params1, windowName);
  433. };
  434.  
  435. unsafeWindow.open = newFunction;
  436.  
  437. unsafeWindow.onbeforeunload = function() {
  438. unsafeWindow.open('', windowName).close();
  439. };
  440.  
  441.  
  442.  
  443.  
  444. var viewingAd = false;
  445. var i = 0;
  446.  
  447. setInterval(function() {
  448.  
  449. //Check if recaptcha or Hcaptcha is selected
  450.  
  451. if (document.querySelector(".form-group.form-code.captcha-type > div span.recaptcha-checked") &&
  452. (document.querySelector(".form-group.form-code.captcha-type > div span.recaptcha-checked").innerText.includes("Hcaptcha") ||
  453. document.querySelector(".form-group.form-code.captcha-type > div span.recaptcha-checked").innerText.includes("GoogleRecaptcha"))) {
  454.  
  455. } else {
  456. //Select either of Hcaptcha or Recaptcha
  457.  
  458. for (let i = 0; i < document.querySelectorAll(".form-group.form-code.captcha-type > div span").length; i++) {
  459.  
  460. if (document.querySelectorAll(".form-group.form-code.captcha-type > div span")[i].innerText.includes("Hcaptcha") ||
  461. document.querySelectorAll(".form-group.form-code.captcha-type > div span")[i].innerText.includes("GoogleRecaptcha")) {
  462. document.querySelectorAll(".form-group.form-code.captcha-type > div span")[i].click();
  463. break;
  464. }
  465.  
  466. }
  467.  
  468. }
  469.  
  470.  
  471. let count = document.querySelectorAll("[class='clearfix container-fluid bgwhite'] [title] span").length;
  472.  
  473. if (i < count && count > 0 && !viewingAd) {
  474. viewingAd = true;
  475. //Click
  476. document.querySelectorAll("[class='clearfix container-fluid bgwhite'] [title] span")[i].click();
  477. setTimeout(function() {
  478. //Wait for completion
  479. var waitForCompletionInterval = setInterval(function() {
  480. // ads has already been clicked
  481. if (document.querySelector(".alert-div.alert-red") && (document.querySelector(".alert-div.alert-red").innerText.includes("advertisement does not") ||
  482. document.querySelector(".alert-div.alert-red").innerText.includes("ads has already been clicked"))) {
  483. var tmp = document.querySelector(".alert-div.alert-red").innerHTML;
  484. document.querySelector(".alert-div.alert-red").innerHTML = tmp.replaceAll("advertisement does not", "")
  485. document.querySelector(".alert-div.alert-red").innerHTML = tmp.replaceAll("ads has already been clicked", "")
  486. i = i + 1;
  487. unsafeWindow.open('', windowName).close();
  488. viewingAd = false;
  489. clearInterval(waitForCompletionInterval);
  490. }
  491. if (document.querySelector("div.warning-ags") &&
  492. (document.querySelector("div.warning-ags").innerText.includes("You closed the advertisement too soon") ||
  493. document.querySelector("div.warning-ags").innerText.includes("The advertisement is not opened correctly"))){
  494. i = i + 1;
  495. unsafeWindow.open('', windowName).close();
  496. viewingAd = false;
  497. clearInterval(waitForCompletionInterval);
  498. }
  499.  
  500. if (count != document.querySelectorAll("[class='clearfix container-fluid bgwhite'] [title] span").length) {
  501.  
  502. //Ad viewed
  503. //Close the window
  504. setTimeout(function() {
  505. unsafeWindow.open('', windowName).close();
  506. viewingAd = false;
  507. clearInterval(waitForCompletionInterval);
  508. }, 3000);
  509. }
  510. }, 5000);
  511. }, 7000);
  512.  
  513. }
  514. if ((count == 0 || count == i) && !viewingAd) {
  515. //Go to next page
  516. i = 0;
  517. var pageCount = document.querySelectorAll("div.coinpayu-pagination > ul > li").length;
  518. if (pageCount >= 1 && document.querySelectorAll("div.coinpayu-pagination > ul > li")[pageCount - 1].className == "active") {
  519. //Stop or go to next url
  520. console.log("Ads End");
  521. goToNextUrl();
  522.  
  523. } else if (pageCount >= 1) {
  524. //go to next page
  525. document.querySelectorAll("div.coinpayu-pagination > ul > li")[pageCount - 1].click();
  526. }
  527.  
  528. }
  529.  
  530. }, 5000);
  531.  
  532. }
  533.  
  534.  
  535. var stopSolvingCaptcha = false;
  536.  
  537. function checkLoginSelectors() {
  538.  
  539. if (websiteDataValues.loginSelectors) {
  540. //Check if all login selectors are present
  541. let count = 0;
  542. for (let i = 0; i < websiteDataValues.loginSelectors.length; i++) {
  543. if (document.querySelector(websiteDataValues.loginSelectors[i])) {
  544. count++;
  545. }
  546.  
  547. }
  548.  
  549. if (count == websiteDataValues.loginSelectors.length) {
  550.  
  551. if (login.length > 0 && password.length > 0) {
  552. //Input Login
  553. document.querySelector(websiteDataValues.loginSelectors[0]).value = login;
  554.  
  555. //Input Password
  556. document.querySelector(websiteDataValues.loginSelectors[1]).value = password;
  557. } else {
  558. stopSolvingCaptcha = true;
  559. }
  560.  
  561. } else {
  562. stopSolvingCaptcha = true;
  563. }
  564.  
  565. } else {
  566. stopSolvingCaptcha = true;
  567. }
  568.  
  569. }
  570.  
  571.  
  572. setTimeout(function() {
  573.  
  574. checkLoginSelectors();
  575.  
  576. if (websiteDataValues.additionalFunctions) {
  577. websiteDataValues.additionalFunctions();
  578. }
  579.  
  580. //Look for all the default messages or errors before proceeding to next url
  581. //For other languages difference in the length of the strings can be compared or visibility of the style element
  582. if (!movingToNextUrl && messageSelectorsPresent()) {
  583. goToNextUrl();
  584. }
  585.  
  586.  
  587. //Check for all the default button selectors and click
  588. //This will only click the first selector found, so mention the selectors with parent element wherever required
  589. if (!movingToNextUrl && websiteDataValues.defaultButtonSelectors) {
  590. for (var i = 0; i < websiteDataValues.defaultButtonSelectors.length; i++) {
  591. if (document.querySelector(websiteDataValues.defaultButtonSelectors[i])) {
  592. document.querySelector(websiteDataValues.defaultButtonSelectors[i]).click();
  593. break;
  594. }
  595. }
  596. }
  597.  
  598. //Input the address and click the login button
  599. if (!movingToNextUrl && document.querySelector(websiteDataValues.inputTextSelector)) {
  600. document.querySelector(websiteDataValues.inputTextSelector).value = websiteDataValues.address;
  601. setTimeout(function() {
  602. if (websiteDataValues.inputTextSelectorButton && document.querySelector(websiteDataValues.inputTextSelectorButton)) {
  603. document.querySelector(websiteDataValues.inputTextSelectorButton).click();
  604. }
  605.  
  606. }, 5000);
  607. }
  608.  
  609. //Click the form button after solving captcha
  610. //Works for both recaptcha and hcaptcha
  611. var clicked = false;
  612. var captchaInterval = setInterval(function() {
  613. if (!stopSolvingCaptcha || !window.location.href.includes("login")) {
  614. try {
  615. if (!clicked && unsafeWindow.grecaptcha && unsafeWindow.grecaptcha.getResponse().length > 0) {
  616. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  617. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  618. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  619. }
  620. }
  621. clicked = true;
  622.  
  623. clearInterval(captchaInterval);
  624. setTimeout(function() {
  625. if (messageSelectorsPresent()) {
  626. goToNextUrl();
  627. }
  628. }, 5000);
  629. }
  630. } catch (e) {
  631.  
  632. }
  633.  
  634. for (var hc = 0; hc < document.querySelectorAll("iframe").length; hc++) {
  635. if (!clicked && document.querySelectorAll("iframe")[hc] &&
  636. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response") &&
  637. document.querySelectorAll("iframe")[hc].getAttribute("data-hcaptcha-response").length > 0) {
  638. for (let i = 0; i < websiteDataValues.captchaButtonSubmitSelector.length; i++) {
  639. if (document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i])) {
  640. document.querySelector(websiteDataValues.captchaButtonSubmitSelector[i]).click();
  641. }
  642. }
  643. clicked = true;
  644. clearInterval(captchaInterval);
  645. setTimeout(function() {
  646. if (messageSelectorsPresent()) {
  647. goToNextUrl();
  648. }
  649. }, 5000);
  650. }
  651. }
  652. }
  653.  
  654. }, 5000);
  655.  
  656.  
  657. }, 5000);
  658.  
  659.  
  660. window.onbeforeunload = function() {
  661. if (unsafeWindow.myWindow) {
  662. unsafeWindow.myWindow.close();
  663. }
  664. if (unsafeWindow.coinwin) {
  665. var tmp = unsafeWindow.coinwin;
  666. unsafeWindow.coinwin = {};
  667. tmp.close();
  668. }
  669.  
  670. };
  671.  
  672. })();