From e5763096a6dde0d7d28727c366a77ccb731cab2d Mon Sep 17 00:00:00 2001 From: Amm0ni4 Date: Thu, 13 Feb 2025 09:17:06 +0100 Subject: [PATCH] fix teknoasian glitching https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated/issues/239 --- Bypass_All_Shortlinks.meta.js | 2 +- Bypass_All_Shortlinks.user.js | 35 +++++++++++++------ extra_bypasses/extra_bypasses.user.js | 33 +++++++++++------ ...ched_Bypass_All_Shortlinks_patched.user.js | 2 +- 4 files changed, 49 insertions(+), 23 deletions(-) diff --git a/Bypass_All_Shortlinks.meta.js b/Bypass_All_Shortlinks.meta.js index 8d39cd3..35aac6a 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.7.10 +// @version 93.7.11 // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle diff --git a/Bypass_All_Shortlinks.user.js b/Bypass_All_Shortlinks.user.js index 4ca69e1..58bb6a5 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.7.10 +// @version 93.7.11 // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle @@ -2459,8 +2459,30 @@ // megalink.pro - https://greasyfork.org/en/scripts/431691-bypass-all-shortlinks/discussions/235270 - https://megalink.pro/pD6wK (nsfw) /megalink.pro\/[a-zA-Z0-9]+$/.test(url) ? afterWindowLoaded(function() {setTimeout(function() {clickIfNotDisabled('a.btn:nth-child(1)')}, 3000)}) : null; - //pahe.ink final step + // pahe.ink /linegee.net|intercelestial.com|teknoasian.com/.test(url) ? preventForcedFocusOnWindow() : null; + + function clickNonStopIfVisible(selector, interval) { + let intervalId = setInterval(() => { + let button = document.querySelector(selector); + let buttonIsVisible = button && button.offsetParent !== null; + if (buttonIsVisible) {button.click();} + }, interval); + } + /teknoasian.com/.test(url) ? afterDOMLoaded(function() { + let intervalId = setInterval(() => { + let button = document.querySelector('.myButton'); + let buttonIsVisible = button && button.offsetParent !== null; + if (buttonIsVisible) { + button.click(); + if (button.classList.contains('postnext')) { + clearInterval(intervalId); + } + } + }, 1000); + }) : null; + + //pahe.ink final step /spacetica.com/.test(url) ? afterDOMLoaded(function() { if (!document.querySelector('.form-group')){ clickIfExists('a.btn-primary.btn-xs'); @@ -2857,15 +2879,6 @@ /freemodsapp.in/.test(url) ? afterDOMLoaded(function() {clickIfExists('#btn6')}) : null; /pandaznetwork.com/.test(url) ? afterDOMLoaded(function() {redirectIfNotDisabled('a.get-link')}) : null; - // pahe.ink - /teknoasian.com/.test(url) ? afterDOMLoaded(function() { - let intervalId = setInterval(() => { - let button = document.querySelector('.myButton'); - let buttonIsVisible = button && button.offsetParent !== null; - if (buttonIsVisible) {button.click();} - }, 500); - }) : null; - //suncy.net (upfiles.com) (seen used in fiuxy2.co) /sunci.net/.test(url) ? afterDOMLoaded(function() {clickIfNotDisabled('button#link-button.btn-primary:not(.btn-download)')}) : null; diff --git a/extra_bypasses/extra_bypasses.user.js b/extra_bypasses/extra_bypasses.user.js index 8b16b31..5532f46 100644 --- a/extra_bypasses/extra_bypasses.user.js +++ b/extra_bypasses/extra_bypasses.user.js @@ -864,8 +864,30 @@ // megalink.pro - https://greasyfork.org/en/scripts/431691-bypass-all-shortlinks/discussions/235270 - https://megalink.pro/pD6wK (nsfw) /megalink.pro\/[a-zA-Z0-9]+$/.test(url) ? afterWindowLoaded(function() {setTimeout(function() {clickIfNotDisabled('a.btn:nth-child(1)')}, 3000)}) : null; - //pahe.ink final step + // pahe.ink /linegee.net|intercelestial.com|teknoasian.com/.test(url) ? preventForcedFocusOnWindow() : null; + + function clickNonStopIfVisible(selector, interval) { + let intervalId = setInterval(() => { + let button = document.querySelector(selector); + let buttonIsVisible = button && button.offsetParent !== null; + if (buttonIsVisible) {button.click();} + }, interval); + } + /teknoasian.com/.test(url) ? afterDOMLoaded(function() { + let intervalId = setInterval(() => { + let button = document.querySelector('.myButton'); + let buttonIsVisible = button && button.offsetParent !== null; + if (buttonIsVisible) { + button.click(); + if (button.classList.contains('postnext')) { + clearInterval(intervalId); + } + } + }, 1000); + }) : null; + + //pahe.ink final step /spacetica.com/.test(url) ? afterDOMLoaded(function() { if (!document.querySelector('.form-group')){ clickIfExists('a.btn-primary.btn-xs'); @@ -1262,15 +1284,6 @@ /freemodsapp.in/.test(url) ? afterDOMLoaded(function() {clickIfExists('#btn6')}) : null; /pandaznetwork.com/.test(url) ? afterDOMLoaded(function() {redirectIfNotDisabled('a.get-link')}) : null; - // pahe.ink - /teknoasian.com/.test(url) ? afterDOMLoaded(function() { - let intervalId = setInterval(() => { - let button = document.querySelector('.myButton'); - let buttonIsVisible = button && button.offsetParent !== null; - if (buttonIsVisible) {button.click();} - }, 500); - }) : null; - //suncy.net (upfiles.com) (seen used in fiuxy2.co) /sunci.net/.test(url) ? afterDOMLoaded(function() {clickIfNotDisabled('button#link-button.btn-primary:not(.btn-download)')}) : null; diff --git a/untouched_Bypass_All_Shortlinks_patched.user.js b/untouched_Bypass_All_Shortlinks_patched.user.js index b88562e..63d14e7 100644 --- a/untouched_Bypass_All_Shortlinks_patched.user.js +++ b/untouched_Bypass_All_Shortlinks_patched.user.js @@ -37,7 +37,7 @@ // @namespace Violentmonkey Scripts // @run-at document-start // @author Bloggerpemula -// @version 93.7.10 +// @version 93.7.11 // @match *://*/* // @grant GM_setValue // @grant GM_getValue