From 4f71088fe0d74921f3f8f515def1a13a0265f550 Mon Sep 17 00:00:00 2001
From: 3970260761 <3970260761@qq.com>
Date: Mon, 2 Nov 2026 14:09:50 +0800
Subject: [PATCH] =?UTF-8?q?v-fixed43:=20IPv6=E6=A3=80=E6=B5=8B=E6=94=B9?=
=?UTF-8?q?=E4=B8=A5=E6=A0=BC=E6=A8=A1=E5=BC=8F(cors+=E6=A0=A1=E9=AA=8CJSO?=
=?UTF-8?q?N),=E7=BC=93=E5=AD=9810=E5=88=86=E9=92=9F=E2=86=922=E5=88=86?=
=?UTF-8?q?=E9=92=9F,=E6=96=B0=E5=A2=9E=E9=87=8D=E6=96=B0=E6=A3=80?=
=?UTF-8?q?=E6=B5=8B=E6=8C=89=E9=92=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
patches/ipv6-page.js | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/patches/ipv6-page.js b/patches/ipv6-page.js
index 132e8c9..1159357 100644
--- a/patches/ipv6-page.js
+++ b/patches/ipv6-page.js
@@ -38,11 +38,14 @@ background:color-mix(in srgb,var(--c) 22%,transparent);color:var(--c);border:1px
.go{margin-top:20px;padding:10px 24px;border:none;border-radius:10px;font-size:14px;font-weight:600;
background:linear-gradient(90deg,#a855f7,#3b82f6);color:#fff;cursor:pointer}
.go:hover{opacity:.9}
+.rebtn{margin-top:10px;padding:7px 18px;border:1px solid rgba(239,68,68,.5);border-radius:8px;
+background:rgba(239,68,68,.15);color:#fca5a5;font-size:13px;cursor:pointer;transition:all .2s}
+.rebtn:hover{background:rgba(239,68,68,.3);color:#fff}
米视TV
选择你当前网络可用的访问线路
正在检测 IPv6 可用性…
-⚠️ 检测到你的网络不支持 IPv6 访问,已隐藏 IPv6 线路。
请使用 IPv4 线路访问。
+⚠️ 检测到你的网络不支持 IPv6 访问,已隐藏 IPv6 线路。
请使用 IPv4 线路访问。
🌐
@@ -80,20 +83,29 @@ var s=document.getElementById('st');if(s){s.textContent='✓ 已检测到你的
function __probe(){
// 当前就在 IPv6 域名上,必然可用
if(location.hostname==='tv6.88531.cn'){__showV6();return}
-// 结果缓存 10 分钟,避免每次刷新都等检测
+// 结果缓存 2 分钟,避免每次刷新都等检测(但不失效太快)
try{var j=JSON.parse(localStorage.getItem("__v6probe")||"null");
-if(j&&(Date.now()-j.t)<600000){j.ok?__showV6():__hideV6();return}}catch(e){}
-// tv6.88531.cn 只有 AAAA 记录,连不上即说明无 IPv6
+if(j&&(Date.now()-j.t)<120000){j.ok?__showV6():__hideV6();return}}catch(e){}
+// tv6.88531.cn 只有 AAAA 记录:用 cors 模式拿真实状态并校验响应体,
+// 只有真正连通并返回合法 JSON 才算支持 IPv6
var c=new AbortController();
-var ti=setTimeout(function(){c.abort()},4000);
+var ti=setTimeout(function(){c.abort()},5000);
fetch("https://tv6.88531.cn/api/license-config?_="+Date.now(),
-{mode:"no-cors",signal:c.signal,cache:"no-store"})
-.then(function(){clearTimeout(ti);
-try{localStorage.setItem("__v6probe",JSON.stringify({t:Date.now(),ok:true}))}catch(e){}
-__showV6()})
+{mode:"cors",signal:c.signal,cache:"no-store",credentials:"omit"})
+.then(function(r){return r.json()})
+.then(function(j){
+clearTimeout(ti);
+var ok=!!(j&&j.code===200&&j.data);
+try{localStorage.setItem("__v6probe",JSON.stringify({t:Date.now(),ok:ok}))}catch(e){}
+ok?__showV6():__hideV6()})
.catch(function(){clearTimeout(ti);
try{localStorage.setItem("__v6probe",JSON.stringify({t:Date.now(),ok:false}))}catch(e){}
__hideV6()})}
+function __reprobe(){try{localStorage.removeItem("__v6probe")}catch(e){}
+var s=document.getElementById('st');if(s){s.textContent='正在重新检测 IPv6…';s.style.color='rgba(255,255,255,.45)';s.style.display='block'}
+var n=document.getElementById('nt');if(n)n.style.display='none';
+var c=document.getElementById('c6');if(c)c.style.display='';
+__probe()}
try{var __c=localStorage.getItem("__v6dest");
if(__c){document.querySelectorAll(".card").forEach(function(c){if((__c==='v6'&&c.classList.contains("v6"))||(__c==='v4'&&c.classList.contains("v4"))){
c.style.borderColor=getComputedStyle(c).getPropertyValue("--c");