// ==UserScript== // @name [New] Coinpayu.com // @namespace https://greasyfork.org/users/1162863 // @version 2.1 // @description Open and close Framed and Frameless Ads // @author Andrewblood // @icon https://coinfinity.top/favicon.ico // @match *://*.coinpayu.com/* // @grant GM_addStyle // @grant GM_setValue // @grant GM_getValue // @grant window.close // @grant window.focus // @antifeature referral-link Referral-Link is in this Script integrated. // @license Copyright Andrewblood // @downloadURL none // ==/UserScript== (function() { 'use strict'; if (window.location.href.includes("coinpayu.com")) { // CSS-Stil für das Overlay var overlayStyle = ` #overlay { position: fixed !important; right: 10px !important; /* Abstand vom linken Rand */ bottom: 10px !important; /* Abstand vom unteren Rand */ width: 300px !important; /* Breite des Overlays */ height: 180px !important; /* Höhe des Overlays */ background-color: rgba(0, 0, 0, 0.5) !important; /* Halbtransparentes Schwarz */ color: black !important; /* Schriftfarbe Schwarz */ padding: 10px !important; z-index: 9999 !important; /* Stellen Sie sicher, dass das Overlay oben liegt */ font-size: 16px !important; /* Schriftgröße 16px */ display: flex; flex-direction: column; /* Überschrift und Inhalt untereinander */ } #overlay h2 { font-size: 20px; /* Größe des h2-Titels */ margin-bottom: 10px; /* Abstand nach unten */ text-align: center; /* Überschrift zentriert */ } .checkbox-container { display: flex; align-items: center; /* Vertikal zentriert */ margin-left: 40px; /* Abstand vom linken Rand */ margin-bottom: 5px; /* Abstand nach unten */ } `; // Füge den CSS-Stil hinzu GM_addStyle(overlayStyle); // Erstelle das Overlay-Element mit innerHTML var overlay = document.createElement('div'); overlay.id = 'overlay'; // Überschrift overlay.innerHTML = '
Faucet Monitor: Open ' + url + ' for ' + time + 'seconds.
', 'green'); if (firstElement) { firstElement.click(); var interval = setInterval(function() { var alertElement = document.querySelector(".alert-div.alert-green"); if (alertElement) { clearInterval(interval); setTimeout(function() { window.location.reload(); }, 1000) } }, 1000) } } else { window.location.replace("https://www.coinpayu.com/dashboard/ads_surf"); } }, 5000); } if(window.location.href.includes("coinpayu.com/dashboard/view_active?id=")){ window.focus(); var intervalId = setInterval(function() { var waittime = document.querySelector("#app > div > div > div > div > div"); if (waittime && waittime.style.width === "100%") { clearInterval(intervalId); setTimeout(function() { window.close(); }, 500); } }, 100); } } if(savedFramelessAdsStatus && window.location.href.includes("coinpayu.com/dashboard/ads_surf")){ setTimeout(function() { var elements = document.querySelectorAll('.clearfix.ags-list-box:not(.gray-all.clearfix.ags-list-box)'); if (elements.length > 0) { var firstElement = elements[0].querySelector('.text-overflow.ags-description > span'); var timeElement = elements[0].querySelector('.ags-detail-time span'); var urlElement = elements[0].querySelector('.text-overflow.ags-description'); var url = urlElement.getAttribute('title'); var time = parseInt(timeElement.textContent); console.log('Open ' + url + ' for ' + time + ' seconds.'); if (firstElement) { firstElement.click(); // Close the Ad var oldfunction = unsafeWindow.open; var windowName = ""; function newFunction(params1, params2) { if (!params2 || params2 == "_blank") { windowName = "popUpWindow"; } else { windowName = params2; } return oldfunction(params1, windowName); }; unsafeWindow.open = newFunction; unsafeWindow.onbeforeunload = function() { unsafeWindow.open('', windowName).close(); }; unsafeWindow.open('', windowName).close(); var interval = setInterval(function() { var alertElement = document.querySelector(".alert-div.alert-green"); if (alertElement) { clearInterval(interval); window.location.reload(); } }, 1000); } } else if (savedCloseStatus) { window.close(); } else { setTimeout(function() { window.location.replace("https://www.coinpayu.com/dashboard/ads_active"); }, 1000*60*60*3); } }, 5000); } } })();