From d318178ec82672db49fdb9ac55043c40db70d044 Mon Sep 17 00:00:00 2001 From: Amm0ni4 Date: Sat, 23 Nov 2024 10:17:56 +0100 Subject: [PATCH] improve profitsfly reload https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated/issues/191 --- Bypass_All_Shortlinks.meta.js | 2 +- Bypass_All_Shortlinks.user.js | 7 +++++-- extra_bypasses/profitsfly_reload_helper.user.js | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Bypass_All_Shortlinks.meta.js b/Bypass_All_Shortlinks.meta.js index 2c5fb20..e61f16a 100644 --- a/Bypass_All_Shortlinks.meta.js +++ b/Bypass_All_Shortlinks.meta.js @@ -4,7 +4,7 @@ // @run-at document-start // @author Amm0ni4 // @noframes -// @version 93.1.9 +// @version 93.1.10 // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle diff --git a/Bypass_All_Shortlinks.user.js b/Bypass_All_Shortlinks.user.js index bdfd638..c82b75b 100644 --- a/Bypass_All_Shortlinks.user.js +++ b/Bypass_All_Shortlinks.user.js @@ -4,7 +4,7 @@ // @run-at document-start // @author Amm0ni4 // @noframes -// @version 93.1.9 +// @version 93.1.10 // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle @@ -2991,12 +2991,15 @@ const domainRegex = /^https:\/\/.*\.(tradeshowrating\.com|historyofyesterday\.com)\/.*/; if (domainRegex.test(window.location.href)) { window.addEventListener('load', function() { + let reloading = false; + // Functions to check for messages like "Click any ad & keep it open for 15 seconds to continue" and reload the page if one exists function checkForMessage() { const paragraphs = document.getElementsByTagName("p"); for (let p of paragraphs) { if (/.*click.+ad.*to.+continue.*/is.test(p.textContent) && isElementVisibleAndEnabled(p)) { - location.reload(); // Reload the page + if (!reloading) location.reload(); // Reload the page + reloading = true; return; // Exit the function after reloading } } diff --git a/extra_bypasses/profitsfly_reload_helper.user.js b/extra_bypasses/profitsfly_reload_helper.user.js index a9a14cb..308725e 100644 --- a/extra_bypasses/profitsfly_reload_helper.user.js +++ b/extra_bypasses/profitsfly_reload_helper.user.js @@ -11,12 +11,15 @@ const domainRegex = /^https:\/\/.*\.(tradeshowrating\.com|historyofyesterday\.com)\/.*/; if (domainRegex.test(window.location.href)) { window.addEventListener('load', function() { + let reloading = false; + // Functions to check for messages like "Click any ad & keep it open for 15 seconds to continue" and reload the page if one exists function checkForMessage() { const paragraphs = document.getElementsByTagName("p"); for (let p of paragraphs) { if (/.*click.+ad.*to.+continue.*/is.test(p.textContent) && isElementVisibleAndEnabled(p)) { - location.reload(); // Reload the page + if (!reloading) location.reload(); // Reload the page + reloading = true; return; // Exit the function after reloading } }