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 <noreply@anthropic.com>
This commit is contained in:
jason5ng32andClaude Fable 5 committed 2026-07-13 09:14:34 +08:00
1 parent e0148b6b17
commit add784a994
5 files changed
+17 -2

No files matched your search

@@ -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 () => {
+1
View File
@@ -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",
+1
View File
@@ -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",
+1
View File
@@ -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",
+1
View File
@@ -281,6 +281,7 @@
"Note": "当你挂上代理或 VPN 之后,你访问的网站真的不知道你挂着代理吗?你真的隐身了么?我们会通过多种手段,尝试计算出你伪装后的漏洞,找到你正在使用代理的证据。尽管可能部分测试结果不完全准确,但本测试依然有较高的参考意义。",
"Note2": "点击运行后,系统将会运行一个脚本,通常在 10s 内将会完成所有的测试,在这个过程中,你的 IP 信息、浏览器信息等将会被收集并在后台进行分析。",
"fetchError": "无法获取测试结果",
"scriptLoadError": "测试脚本加载失败,无法继续测试。请检查网络后重试。",
"yourIP": "你的主测 IP 是",
"proxyScore": "代理概率",
"VPNScore": "VPN 概率",