From add784a9949c4830763ec36144065be6d132cfc7 Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Mon, 13 Jul 2026 09:14:34 +0800 Subject: [PATCH] Fix(invisibilitytest): abort the run when the probe script fails to load Without the script no probe data ever reaches the server, so polling just made users wait ~40s for a generic fetch error. Surface a dedicated message immediately instead (all four locales). Co-Authored-By: Claude Fable 5 --- .../advanced-tools/InvisibilityTest.vue | 15 +++++++++++++-- frontend/locales/en.json | 1 + frontend/locales/fr.json | 1 + frontend/locales/tr.json | 1 + frontend/locales/zh.json | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/components/advanced-tools/InvisibilityTest.vue b/frontend/components/advanced-tools/InvisibilityTest.vue index 0a192d21..adcd35cd 100644 --- a/frontend/components/advanced-tools/InvisibilityTest.vue +++ b/frontend/components/advanced-tools/InvisibilityTest.vue @@ -250,7 +250,16 @@ const loadScript = () => { script.src = `https://proxydetectjs.ipcheck.ing/?pdKey=${import.meta.env.VITE_INVISIBILITY_TEST_KEY}&pdVal=${userID.value}`; script.async = true; script.setAttribute('data-tag', 'invisibilityTestScript'); - script.onerror = (error) => { console.error('Script load error:', error); }; + // No script means no probe data server-side — polling for a result is + // pointless, so abort the run and tell the user right away. + script.onerror = () => { + console.error('Script load error: proxy detect script failed to load'); + clearTimeout(resultTimer); + removeScript(); + errorMsg.value = t('invisibilitytest.scriptLoadError'); + checkingStatus.value = 'idle'; + retryCount.value = 0; + }; document.head.appendChild(script); }; @@ -259,6 +268,8 @@ const removeScript = () => { scripts.forEach(script => script.remove()); }; +let resultTimer = null; + const onSubmit = () => { checkingStatus.value = 'running'; userID.value = generate28DigitString(); @@ -268,7 +279,7 @@ const onSubmit = () => { loadScript(); // Achievement rule (JustInCase) lives in data/achievement-rules.js. emitAppEvent('invisibility:started'); - setTimeout(() => { getResult(); }, 10000); + resultTimer = setTimeout(() => { getResult(); }, 10000); }; const getResult = async () => { diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 0bbb0eb5..9a0f8e25 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -300,6 +300,7 @@ "Note": "When you use a proxy or VPN, do the websites you visit really not know that you are using a proxy? Are you truly invisible? We will use various methods to try to calculate the vulnerabilities in your disguise and find evidence that you are using a proxy. Although some test results may not be completely accurate, this test is still highly informative.", "Note2": "After clicking Run, the system will run a script that usually completes all tests within 10 seconds. During this process, your IP information, browser information, etc. will be collected and analyzed in the background.", "fetchError": "Unable to fetch test results", + "scriptLoadError": "The test script failed to load, so the test cannot continue. Please check your network and try again.", "yourIP": "Your main test IP is", "proxyScore": "Proxy Percentage", "VPNScore": "VPN Percentage", diff --git a/frontend/locales/fr.json b/frontend/locales/fr.json index 56e52460..6831fbf9 100644 --- a/frontend/locales/fr.json +++ b/frontend/locales/fr.json @@ -281,6 +281,7 @@ "Note": "Lorsque vous utilisez un proxy ou un VPN, les sites que vous visitez ne savent-ils vraiment pas que vous utilisez un proxy ? Êtes-vous réellement invisible ? Nous utiliserons plusieurs méthodes pour essayer de détecter les failles de votre anonymat et trouver des preuves de l'utilisation d'un proxy. Bien que certains résultats de test puissent ne pas être entièrement précis, ce test reste très instructif.", "Note2": "Après avoir cliqué sur Exécuter, le système exécutera un script qui terminera généralement tous les tests en moins de 10 secondes. Pendant ce processus, vos informations IP, les informations de votre navigateur, etc. seront collectées et analysées en arrière-plan.", "fetchError": "Impossible de récupérer les résultats du test", + "scriptLoadError": "Le script de test n'a pas pu être chargé, le test ne peut donc pas continuer. Vérifiez votre réseau et réessayez.", "yourIP": "Votre adresse IP principale est", "proxyScore": "Pourcentage de proxy", "VPNScore": "Pourcentage de VPN", diff --git a/frontend/locales/tr.json b/frontend/locales/tr.json index dbc3aff1..27796612 100644 --- a/frontend/locales/tr.json +++ b/frontend/locales/tr.json @@ -300,6 +300,7 @@ "Note": "Bir proxy veya VPN kullandığınızda, ziyaret ettiğiniz web siteleri gerçekten bir proxy kullandığınızı bilmiyor mu? Gerçekten görünmez misiniz? Kılığınızdaki açıkları hesaplamak ve bir proxy kullandığınıza dair kanıt bulmak için çeşitli yöntemler kullanacağız. Bazı test sonuçları tamamen doğru olmasa da, bu test yine de oldukça bilgilendiricidir.", "Note2": "Çalıştır'a tıkladıktan sonra, sistem genellikle tüm testleri 10 saniye içinde tamamlayan bir komut dosyası çalıştıracaktır. Bu süreçte IP bilgileriniz, tarayıcı bilgileriniz vb. toplanacak ve arka planda analiz edilecektir.", "fetchError": "Test sonuçları alınamadı", + "scriptLoadError": "Test betiği yüklenemediği için teste devam edilemiyor. Lütfen ağınızı kontrol edip tekrar deneyin.", "yourIP": "Ana test IP'niz", "proxyScore": "Proxy Yüzdesi", "VPNScore": "VPN Yüzdesi", diff --git a/frontend/locales/zh.json b/frontend/locales/zh.json index 26261561..6b9638cf 100644 --- a/frontend/locales/zh.json +++ b/frontend/locales/zh.json @@ -281,6 +281,7 @@ "Note": "当你挂上代理或 VPN 之后,你访问的网站真的不知道你挂着代理吗?你真的隐身了么?我们会通过多种手段,尝试计算出你伪装后的漏洞,找到你正在使用代理的证据。尽管可能部分测试结果不完全准确,但本测试依然有较高的参考意义。", "Note2": "点击运行后,系统将会运行一个脚本,通常在 10s 内将会完成所有的测试,在这个过程中,你的 IP 信息、浏览器信息等将会被收集并在后台进行分析。", "fetchError": "无法获取测试结果", + "scriptLoadError": "测试脚本加载失败,无法继续测试。请检查网络后重试。", "yourIP": "你的主测 IP 是", "proxyScore": "代理概率", "VPNScore": "VPN 概率",