profitsfly improvement thanks to Anon991299

https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated/issues/191
This commit is contained in:
Amm0ni4 2024-12-03 21:49:08 +01:00
parent 2f1925d88d
commit 3b74040371
3 changed files with 68 additions and 8 deletions

View file

@ -4,7 +4,7 @@
// @run-at document-start // @run-at document-start
// @author Amm0ni4 // @author Amm0ni4
// @noframes // @noframes
// @version 93.2.3 // @version 93.2.4
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
// @grant GM_addStyle // @grant GM_addStyle

View file

@ -4,7 +4,7 @@
// @run-at document-start // @run-at document-start
// @author Amm0ni4 // @author Amm0ni4
// @noframes // @noframes
// @version 93.2.3 // @version 93.2.4
// @grant GM_setValue // @grant GM_setValue
// @grant GM_getValue // @grant GM_getValue
// @grant GM_addStyle // @grant GM_addStyle
@ -3008,10 +3008,39 @@
const domainRegex = /^https:\/\/.*\.(tradeshowrating.com|historyofyesterday.com|playonpc.online|quins.us)\/.*/; const domainRegex = /^https:\/\/.*\.(tradeshowrating.com|historyofyesterday.com|playonpc.online|quins.us)\/.*/;
if (domainRegex.test(window.location.href)) { if (domainRegex.test(window.location.href)) {
window.addEventListener('load', function() { // Back up the current ref url
let reloading = false; if (window.location.href.includes("/ref.php")) {
GM_setValue("profitsflyLocation", window.location.href);
}
// Functions to check for messages like "Click any ad & keep it open for 15 seconds to continue" and reload the page if one exists window.addEventListener('load', function() {
// 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;
}
}
}
// 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;
function checkForMessage() { function checkForMessage() {
const paragraphs = document.getElementsByTagName("p"); const paragraphs = document.getElementsByTagName("p");
for (let p of paragraphs) { for (let p of paragraphs) {
@ -3049,6 +3078,7 @@
})(); })();
//------- //-------
// ----- Bypass Rinku ------ // ----- Bypass Rinku ------
// source: https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated/issues/165 // source: https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated/issues/165
// example: https://rinku.me/0XLi6 // example: https://rinku.me/0XLi6

View file

@ -10,10 +10,39 @@
const domainRegex = /^https:\/\/.*\.(tradeshowrating.com|historyofyesterday.com|playonpc.online|quins.us)\/.*/; const domainRegex = /^https:\/\/.*\.(tradeshowrating.com|historyofyesterday.com|playonpc.online|quins.us)\/.*/;
if (domainRegex.test(window.location.href)) { if (domainRegex.test(window.location.href)) {
window.addEventListener('load', function() { // Back up the current ref url
let reloading = false; if (window.location.href.includes("/ref.php")) {
GM_setValue("profitsflyLocation", window.location.href);
}
// Functions to check for messages like "Click any ad & keep it open for 15 seconds to continue" and reload the page if one exists window.addEventListener('load', function() {
// 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;
}
}
}
// 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;
function checkForMessage() { function checkForMessage() {
const paragraphs = document.getElementsByTagName("p"); const paragraphs = document.getElementsByTagName("p");
for (let p of paragraphs) { for (let p of paragraphs) {
@ -50,3 +79,4 @@
} }
})(); })();
//------- //-------