2024-11-08 17:05:35 +05:00
|
|
|
// ==UserScript==
|
|
|
|
// @name profitsfly reload helper
|
2024-12-01 15:40:09 +05:00
|
|
|
// @include /^https:\/\/.*\.(tradeshowrating.com|historyofyesterday.com|playonpc.online|quins.us)\/.*/
|
2024-11-08 17:05:35 +05:00
|
|
|
// @run-at document-start
|
|
|
|
// ==/UserScript==
|
|
|
|
|
|
|
|
//---profitsfly reload helper----
|
|
|
|
(function() {
|
|
|
|
"use strict";
|
|
|
|
|
2024-12-01 15:40:09 +05:00
|
|
|
const domainRegex = /^https:\/\/.*\.(tradeshowrating.com|historyofyesterday.com|playonpc.online|quins.us)\/.*/;
|
2024-11-08 17:05:35 +05:00
|
|
|
if (domainRegex.test(window.location.href)) {
|
2024-12-04 01:49:08 +05:00
|
|
|
// Back up the current ref url
|
|
|
|
if (window.location.href.includes("/ref.php")) {
|
|
|
|
GM_setValue("profitsflyLocation", window.location.href);
|
|
|
|
}
|
|
|
|
|
2024-11-08 17:05:35 +05:00
|
|
|
window.addEventListener('load', function() {
|
2024-12-04 01:49:08 +05:00
|
|
|
// Check if the current URL is just the domain
|
|
|
|
const url = new URL(window.location.href);
|
|
|
|
const path = url.pathname;
|
|
|
|
if (path === "/" || path === "") {
|
|
|
|
if (document.body.textContent.includes("You have 2 active sessions.")) {
|
|
|
|
// Click the continue button if a backed up url was loaded in the last 5 seconds
|
|
|
|
if ((Date.now() - GM_getValue("profitsflyGoBackTime", 0)) < 5000) {
|
|
|
|
for (const button of document.querySelectorAll("button")) {
|
|
|
|
if (button.textContent.trim() === "Continue") {
|
|
|
|
button.click();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// Load the backed up url
|
|
|
|
const lastLocation = GM_getValue("profitsflyLocation");
|
|
|
|
if (lastLocation) {
|
|
|
|
GM_setValue("profitsflyGoBackTime", Date.now());
|
|
|
|
GM_setValue("profitsflyOverrideLocation", lastLocation);
|
|
|
|
window.location.href = lastLocation;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-11-23 14:17:56 +05:00
|
|
|
|
2024-12-04 01:49:08 +05:00
|
|
|
// Function to check for messages like "Click any ad & keep it open for 15 seconds to continue" and reload the page if one exists
|
|
|
|
let reloading = false;
|
2024-11-08 17:05:35 +05:00
|
|
|
function checkForMessage() {
|
|
|
|
const paragraphs = document.getElementsByTagName("p");
|
|
|
|
for (let p of paragraphs) {
|
|
|
|
if (/.*click.+ad.*to.+continue.*/is.test(p.textContent) && isElementVisibleAndEnabled(p)) {
|
2024-11-23 14:17:56 +05:00
|
|
|
if (!reloading) location.reload(); // Reload the page
|
|
|
|
reloading = true;
|
2024-11-08 17:05:35 +05:00
|
|
|
return; // Exit the function after reloading
|
|
|
|
}
|
|
|
|
}
|
2024-11-27 22:51:11 +05:00
|
|
|
if (document.body.textContent.includes("Less than 18 seconds have passed between actions. Robot verification failed, please try again...")) {
|
|
|
|
if (!reloading) location.reload(); // Reload the page
|
|
|
|
reloading = true;
|
|
|
|
return; // Exit the function after reloading
|
|
|
|
}
|
2024-11-08 17:05:35 +05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Helper function to determine if an element is visible and enabled
|
|
|
|
function isElementVisibleAndEnabled(el) {
|
|
|
|
// Check if the element and all its parents are visible
|
|
|
|
let currentElement = el;
|
|
|
|
while (currentElement) {
|
|
|
|
const style = getComputedStyle(currentElement);
|
|
|
|
if (style.display === "none" || style.visibility === "hidden") {
|
|
|
|
return false; // Element or parent is not visible
|
|
|
|
}
|
|
|
|
currentElement = currentElement.parentElement; // Move up the DOM tree
|
|
|
|
}
|
|
|
|
// Check if the button is enabled
|
|
|
|
return !el.disabled;
|
|
|
|
}
|
|
|
|
|
|
|
|
setInterval(checkForMessage, 1000);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
//-------
|
2024-12-04 01:49:08 +05:00
|
|
|
|