From 2ff10df90c26e39810cffc93b519ffcc9bc3c654 Mon Sep 17 00:00:00 2001 From: Kato Date: Sat, 5 Sep 2026 21:25:30 +0000 Subject: [PATCH] =?UTF-8?q?Fix=20login=20link=20=E2=80=94=20open=20via=20w?= =?UTF-8?q?indow.open=20with=20popup-blocker=20fallback,=20preventDefault?= =?UTF-8?q?=20on=20anchor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/main.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 44f64cc..2418469 100644 --- a/js/main.js +++ b/js/main.js @@ -97,8 +97,16 @@ document.addEventListener('DOMContentLoaded', () => { // Login button — opens Telegram bot deep-link, then locks itself const loginBtn = document.getElementById('login-btn'); if (loginBtn) { - loginBtn.addEventListener('click', () => { - // No modal: swap label, drop the link, make the button unclickable + loginBtn.addEventListener('click', (e) => { + e.preventDefault(); + const url = loginBtn.href; + // Open the link programmatically (reliable than relying on href after DOM changes) + const w = window.open(url, '_blank'); + if (!w || w.closed) { + // Popup blocked — fallback: navigate same window + window.location.href = url; + } + // Then swap label and lock loginBtn.innerHTML = 'Approve in Telegram'; loginBtn.removeAttribute('href'); loginBtn.classList.add('btn-locked');