From d6a99548d64925d06c41743956deadf05fa19c8b Mon Sep 17 00:00:00 2001 From: Amm0ni4 Date: Thu, 20 Feb 2025 15:32:28 +0100 Subject: [PATCH] fix teknoasian https://codeberg.org/Amm0ni4/bypass-all-shortlinks-debloated/issues/246 --- Bypass_All_Shortlinks.meta.js | 2 +- Bypass_All_Shortlinks.user.js | 42 ++++++++++++------- extra_bypasses/extra_bypasses.user.js | 40 +++++++++++------- ...ched_Bypass_All_Shortlinks_patched.user.js | 2 +- 4 files changed, 55 insertions(+), 31 deletions(-) diff --git a/Bypass_All_Shortlinks.meta.js b/Bypass_All_Shortlinks.meta.js index 145ddf2..6803683 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.8.6 +// @version 93.8.7 // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle diff --git a/Bypass_All_Shortlinks.user.js b/Bypass_All_Shortlinks.user.js index 17ad279..f127b9b 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.8.6 +// @version 93.8.7 // @grant GM_setValue // @grant GM_getValue // @grant GM_addStyle @@ -2152,26 +2152,38 @@ // pahe.ink /linegee.net|intercelestial.com|teknoasian.com/.test(url) ? preventForcedFocusOnWindow() : null; + function isWeirdButton(button) { + const suspiciousStyles = ['position: absolute;left: 99999px;']; + const suspiciousWords = ['patch']; - function clickNonStopIfVisible(selector, interval) { - let intervalId = setInterval(() => { - let button = document.querySelector(selector); - let buttonIsVisible = button && button.offsetParent !== null; - if (buttonIsVisible) {button.click();} - }, interval); + // Check for suspicious styles + const style = button.getAttribute('style'); + if (style && suspiciousStyles.some(s => style.includes(s))) { + return true; + } + + // Check for suspicious words in text content + const textContent = button.textContent.toLowerCase(); + if (suspiciousWords.some(word => textContent.includes(word))) { + return true; + } + + return false; } - /* /teknoasian.com/.test(url) ? afterDOMLoaded(function() { + /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); + let buttons = document.querySelectorAll('button.verify, button.skipcontent, button.postnext'); + for (let button of buttons) { + let buttonIsVisible = button && button.offsetParent !== null; + if (buttonIsVisible && !isWeirdButton(button)) { + button.click(); + if (button.classList.contains('postnext')) { + clearInterval(intervalId); + } } } }, 1000); - }) : null; */ + }) : null; //pahe.ink final step /linegee.net/.test(url) ? afterDOMLoaded(function() { diff --git a/extra_bypasses/extra_bypasses.user.js b/extra_bypasses/extra_bypasses.user.js index 09b2641..135bca3 100644 --- a/extra_bypasses/extra_bypasses.user.js +++ b/extra_bypasses/extra_bypasses.user.js @@ -888,26 +888,38 @@ // pahe.ink /linegee.net|intercelestial.com|teknoasian.com/.test(url) ? preventForcedFocusOnWindow() : null; + function isWeirdButton(button) { + const suspiciousStyles = ['position: absolute;left: 99999px;']; + const suspiciousWords = ['patch']; - function clickNonStopIfVisible(selector, interval) { - let intervalId = setInterval(() => { - let button = document.querySelector(selector); - let buttonIsVisible = button && button.offsetParent !== null; - if (buttonIsVisible) {button.click();} - }, interval); + // Check for suspicious styles + const style = button.getAttribute('style'); + if (style && suspiciousStyles.some(s => style.includes(s))) { + return true; + } + + // Check for suspicious words in text content + const textContent = button.textContent.toLowerCase(); + if (suspiciousWords.some(word => textContent.includes(word))) { + return true; + } + + return false; } - /* /teknoasian.com/.test(url) ? afterDOMLoaded(function() { + /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); + let buttons = document.querySelectorAll('button.verify, button.skipcontent, button.postnext'); + for (let button of buttons) { + let buttonIsVisible = button && button.offsetParent !== null; + if (buttonIsVisible && !isWeirdButton(button)) { + button.click(); + if (button.classList.contains('postnext')) { + clearInterval(intervalId); + } } } }, 1000); - }) : null; */ + }) : null; //pahe.ink final step /linegee.net/.test(url) ? afterDOMLoaded(function() { diff --git a/untouched_Bypass_All_Shortlinks_patched.user.js b/untouched_Bypass_All_Shortlinks_patched.user.js index fcce9fe..d630834 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.8.6 +// @version 93.8.7 // @match *://*/* // @grant GM_setValue // @grant GM_getValue